Hyperlinkv0.8.0-beta.28

Store

Store.StoreProvidedContexttypesrc/Store.ts:586
StoreProvidedContext<T, Ctx>

Remove the requirement channel Ctx from every method in a resolved-effects shape, recursing into nested sub-trees — the per-method-precise result of provideContext. Mirrors CatchWriteError, but subtracts the provided context Ctx from each method's requirement rather than catching an error — sound like Effect.provideContext (RExclude<R, Ctx>), so a requirement the context does not cover survives as a residual (caught at a later assignment) instead of being silently claimed never. A write method (...a) => Effect<S, E, R>(...a) => Effect<S, E, Exclude<R, Ctx>>; a bare Effect custom member is subtracted too; the StoreEffectsVariance brand's non-effect members pass through (the function-passthrough branch keeps _C intact); a sub-tree recurses.

modelsprovideContextCatchWriteErrorEffectStoreEffectsVariance
Source src/Store.ts:58611 lines
export type StoreProvidedContext<T, Ctx> = T extends (
  ...args: infer A
) => Effect.Effect<infer S, infer E, infer R>
  ? (...args: A) => Effect.Effect<S, E, Exclude<R, Ctx>>
  : T extends Effect.Effect<infer S, infer E, infer R>
    ? Effect.Effect<S, E, Exclude<R, Ctx>>
    : T extends (...args: ReadonlyArray<never>) => unknown
      ? T
      : T extends object
        ? { readonly [K in keyof T]: StoreProvidedContext<T[K], Ctx> }
        : T;
Referenced by 1 symbols