MCPcopy Create free account
hub / github.com/effect-app/libs / cachedPerRequest

Function cachedPerRequest

packages/effect-app/src/Store.ts:253–260  ·  view source on GitHub ↗
(
  make: Effect.Effect<A, E, R>
)

Source from the content-addressed store, hash-verified

251 * Uses the ContextMap's shared semaphore for safe single initialization.
252 */
253export const cachedPerRequest = <A, E, R>(
254 make: Effect.Effect<A, E, R>
255): Effect.Effect<A, E | ContextMapNotStartedError, R> => {
256 const cacheKey = Symbol()
257 return getContextMap.pipe(
258 Effect.flatMap((ctxMap) => ctxMap.getOrCreateStoreEffect(cacheKey, make))
259 )
260}
261
262const defaultNs: NonEmptyString255 = NonEmptyString255("primary")
263export class storeId extends Context.Reference("StoreId", { defaultValue: (): NonEmptyString255 => defaultNs }) {}

Callers

nothing calls this directly

Calls 2

pipeMethod · 0.65
SymbolInterface · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…