Function
modify
(key: string, f: (value: S["Type"]) => S["Type"])
Source from the content-addressed store, hash-verified
| 783 | const set = (key: string, value: S["Type"]) => Effect.flatMap(encode(value), (json) => self.set(key, json)) |
| 784 | |
| 785 | const modify = (key: string, f: (value: S["Type"]) => S["Type"]) => |
| 786 | Effect.flatMap( |
| 787 | get(key), |
| 788 | (o) => { |
| 789 | if (Option.isNone(o)) { |
| 790 | return Effect.succeedNone |
| 791 | } |
| 792 | const newValue = f(o.value) |
| 793 | return Effect.as( |
| 794 | set(key, newValue), |
| 795 | Option.some(newValue) |
| 796 | ) |
| 797 | } |
| 798 | ) |
| 799 | |
| 800 | return { |
| 801 | [SchemaStoreTypeId]: SchemaStoreTypeId, |
Callers
nothing calls this directly
Tested by
no test coverage detected