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

Function fromFunction

packages/effect/src/internal/layer.ts:663–667  ·  view source on GitHub ↗
(
  tagA: Context.Tag<I1, S1>,
  tagB: Context.Tag<I2, S2>,
  f: (a: Types.NoInfer<S1>) => Types.NoInfer<S2>
)

Source from the content-addressed store, hash-verified

661
662/** @internal */
663export const fromFunction = <I1, S1, I2, S2>(
664 tagA: Context.Tag<I1, S1>,
665 tagB: Context.Tag<I2, S2>,
666 f: (a: Types.NoInfer<S1>) => Types.NoInfer<S2>
667): Layer.Layer<I2, never, I1> => fromEffectContext(core.map(tagA, (a) => Context.make(tagB, f(a))))
668
669/** @internal */
670export const launch = <RIn, E, ROut>(self: Layer.Layer<ROut, E, RIn>): Effect.Effect<never, E, RIn> =>

Callers

nothing calls this directly

Calls 4

fromEffectContextFunction · 0.85
mapMethod · 0.65
makeMethod · 0.65
fFunction · 0.50

Tested by

no test coverage detected