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

Function serviceWith

packages/effect/src/internal/sink.ts:1748–1751  ·  view source on GitHub ↗
(
  tag: Context.Tag<I, S>,
  f: (service: Types.NoInfer<S>) => Z
)

Source from the content-addressed store, hash-verified

1746
1747/** @internal */
1748export const serviceWith = <I, S, Z>(
1749 tag: Context.Tag<I, S>,
1750 f: (service: Types.NoInfer<S>) => Z
1751): Sink.Sink<Z, unknown, never, never, I> => fromEffect(Effect.map(tag, f))
1752
1753/** @internal */
1754export const serviceWithEffect = <I, S, R, E, Z>(

Callers 1

serviceFunction · 0.70

Calls 2

fromEffectFunction · 0.70
mapMethod · 0.65

Tested by

no test coverage detected