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

Class RecordMap

packages/effect/test/LayerMap.test.ts:91–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }) {}
90
91 class RecordMap extends LayerMap.Service<RecordMap>()("LayerMapTest/RecordMap", {
92 layers: {
93 short: makeLayer("short", acquired, released),
94 long: makeLayer("long", acquired, released)
95 },
96 idleTimeToLive: (key) => {
97 const key_: "short" | "long" = key
98 return key_ === "short" ? 500 : 2000
99 }
100 }) {}
101
102 yield* Effect.scoped(LookupMap.contextEffect("short:a").pipe(Effect.provide(LookupMap.layer)))
103 yield* Effect.scoped(RecordMap.contextEffect("short").pipe(Effect.provide(RecordMap.layer)))

Callers

nothing calls this directly

Calls 1

makeLayerFunction · 0.70

Tested by

no test coverage detected