MCPcopy Index your code
hub / github.com/Effect-TS/effect / fromFunction

Function fromFunction

packages/effect/src/internal/layer.ts:662–666  ·  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

660
661/** @internal */
662export const fromFunction = <I1, S1, I2, S2>(
663 tagA: Context.Tag<I1, S1>,
664 tagB: Context.Tag<I2, S2>,
665 f: (a: Types.NoInfer<S1>) => Types.NoInfer<S2>
666): Layer.Layer<I2, never, I1> => fromEffectContext(core.map(tagA, (a) => Context.make(tagB, f(a))))
667
668/** @internal */
669export 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