MCPcopy Create free account
hub / github.com/Effect-TS/effect / get

Function get

packages/effect/src/unstable/persistence/KeyValueStore.ts:774–781  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

772 const encode = Schema.encodeEffect(jsonSchema)
773
774 const get = (key: string) =>
775 Effect.flatMap(
776 self.get(key),
777 UndefinedOr.match({
778 onUndefined: () => Effect.succeedNone,
779 onDefined: (value) => Effect.asSome(decode(value))
780 })
781 )
782
783 const set = (key: string, value: S["Type"]) => Effect.flatMap(encode(value), (json) => self.set(key, json))
784

Callers 1

modifyFunction · 0.70

Calls 2

getMethod · 0.65
decodeFunction · 0.50

Tested by

no test coverage detected