Skip to content

TypeScript API / contentia/core / ContentiaTask / fromChannel

Function: fromChannel() ​

ts
function fromChannel<A, R>(channel): ContentiaTask<A, R>;

Give a Channel the ContentiaTask members: run, then (so it can be awaited) and the async iterator over its metadata chunks. Every constructor and combinator in this module returns through here.

Effect's own Channel functions return plain Channels without these members. If you build a task with them, pass the result through fromChannel before handing it to code that awaits it.

Type Parameters ​

Type ParameterDefault type
A-
Rnever

Parameters ​

ParameterType
channelChannel<readonly [ContentiaMetadata, ContentiaMetadata], ContentiaError<ErrorCode, number>, A, unknown, unknown, unknown, R>

Returns ​

ContentiaTask<A, R>