(key: string)
| 127 | const encode = Schema.encode(jsonSchema) |
| 128 | |
| 129 | const get = (key: string) => |
| 130 | Effect.flatMap( |
| 131 | store.get(key), |
| 132 | Option.match({ |
| 133 | onNone: () => Effect.succeedNone, |
| 134 | onSome: (value) => Effect.asSome(parse(value)) |
| 135 | }) |
| 136 | ) |
| 137 | |
| 138 | const set = (key: string, value: A) => Effect.flatMap(encode(value), (json) => store.set(key, json)) |
| 139 |