TypeScript API / contentia/core / ContentiaStream / fromChannel
Function: fromChannel()
ts
function fromChannel<A, D, R>(channel): ContentiaStream<A, D, R>;Give a Channel the ContentiaStream members: collect and the async iterator over its items. 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 stream with them, pass the result through fromChannel before handing it to code that iterates or collects it.
Type Parameters
| Type Parameter | Default type |
|---|---|
A | - |
D extends ContentiaDone | - |
R | never |
Parameters
| Parameter | Type |
|---|---|
channel | Channel<readonly [ContentiaElement<A>, ContentiaElement<A>], ContentiaError<ErrorCode, number>, D, unknown, unknown, unknown, R> |
Returns
ContentiaStream<A, D, R>