(str: string | null)
| 888 | Effect.sync(() => { |
| 889 | const prefixed = (key: string) => `${prefix}:${key}` |
| 890 | const parse = (str: string | null) => { |
| 891 | if (str === null) { |
| 892 | return Effect.undefined |
| 893 | } |
| 894 | try { |
| 895 | return Effect.succeed(JSON.parse(str)) |
| 896 | } catch (cause) { |
| 897 | return Effect.fail( |
| 898 | new PersistenceError({ |
| 899 | message: `Failed to parse value from Redis`, |
| 900 | cause |
| 901 | }) |
| 902 | ) |
| 903 | } |
| 904 | } |
| 905 | return identity<BackingPersistenceStore>({ |
| 906 | get: (key) => |
| 907 | Effect.flatMap( |