Take.ts
Take.ts overview
Section titled “Take.ts overview”The Take module provides the stored representation of one pull result from
a stream-like producer. A Take<A, E, Done> is either a non-empty batch of
emitted values, a failed Exit, or a successful Exit carrying the
completion value.
Since v2.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”converting
Section titled “converting”toPull
Section titled “toPull”Converts a Take into a Pull, succeeding with value batches, failing with
failure exits, and translating successful exits into pull completion.
When to use
Use to interpret a stored or transferred Take as a Pull step while
preserving emitted batches, ordinary failures, and completion values.
Signature
declare const toPull: <A, E, Done>(take: Take<A, E, Done>) => Pull.Pull<NonEmptyReadonlyArray<A>, E, Done>Since v4.0.0
models
Section titled “models”Take (type alias)
Section titled “Take (type alias)”Represents one pull result: either a non-empty batch of values, a failure
Exit, or a successful Exit that signals completion with a Done value.
When to use
Use to store, transfer, or interpret pull results later while preserving emitted values, failures, and normal completion.
See
toPullfor interpreting aTakeas aPullstep
Signature
type Take<A, E, Done> = NonEmptyReadonlyArray<A> | Exit.Exit<Done, E>Since v2.0.0