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

Function toChannel

packages/effect/src/Sink.ts:331–339  ·  view source on GitHub ↗
(
  self: Sink<A, In, L, E, R>
)

Source from the content-addressed store, hash-verified

329 * @since 2.0.0
330 */
331export const toChannel = <A, In, L, E, R>(
332 self: Sink<A, In, L, E, R>
333): Channel.Channel<never, E, End<A, L>, NonEmptyReadonlyArray<In>, never, void, R> =>
334 Channel.fromTransform((upstream, scope) =>
335 Effect.succeed(Effect.flatMap(
336 self.transform(upstream, scope),
337 Cause.done
338 ))
339 )
340
341/**
342 * Creates a pipe-style constructor for sinks over input type `In`.

Callers

nothing calls this directly

Calls 2

transformMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected