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

Function fromChannel

packages/effect/src/Sink.ts:235–251  ·  view source on GitHub ↗
(
  channel: Channel.Channel<
    never,
    E,
    End<A, L>,
    NonEmptyReadonlyArray<In>,
    never,
    void,
    R
  >
)

Source from the content-addressed store, hash-verified

233 * @since 2.0.0
234 */
235export const fromChannel = <L, In, E, A, R>(
236 channel: Channel.Channel<
237 never,
238 E,
239 End<A, L>,
240 NonEmptyReadonlyArray<In>,
241 never,
242 void,
243 R
244 >
245): Sink<A, In, L, E, R> =>
246 fromTransform((upstream, scope) =>
247 Channel.toTransform(channel)(upstream, scope).pipe(
248 Effect.flatMap(Effect.forever({ disableYield: true })),
249 Pull.catchDone(Effect.succeed)
250 ) as Effect.Effect<End<A, L>, E, R>
251 )
252
253/**
254 * Creates a sink that writes its input to a Web `WritableStream`.

Callers 15

fromWritableStreamFunction · 0.70
unwrapFunction · 0.70
fromEffectFunction · 0.70
fromPullFunction · 0.70
transformPullFunction · 0.70
transformPullBracketFunction · 0.70
callbackFunction · 0.70
Stream.tsFile · 0.70
succeedFunction · 0.70
syncFunction · 0.70
suspendFunction · 0.70
failFunction · 0.70

Calls 2

fromTransformFunction · 0.70
pipeMethod · 0.65

Tested by

no test coverage detected