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

Function suspend

packages/effect/src/Channel.ts:549–552  ·  view source on GitHub ↗
(
  evaluate: LazyArg<Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>>
)

Source from the content-addressed store, hash-verified

547 * @since 2.0.0
548 */
549export const suspend = <OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>(
550 evaluate: LazyArg<Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env>>
551): Channel<OutElem, OutErr, OutDone, InElem, InErr, InDone, Env> =>
552 fromTransform((upstream, scope) => Effect.suspend(() => toTransform(evaluate())(upstream, scope)))
553
554/**
555 * Acquires a resource, uses it to build a `Channel`, and guarantees that

Callers 1

Channel.tsFile · 0.70

Calls 3

toTransformFunction · 0.85
fromTransformFunction · 0.70
evaluateFunction · 0.70

Tested by

no test coverage detected