An extension to the :class that immediately queues the entire contents of whatever has been previously consumed.
ForkableReplayStream:class
const forkable = new ForkableReplayStream<number>()const writable = new WritableStream(forkable)await fromCollection([1, 2, 3, 4, 5, 6, 7]).pipeTo(writable) Copy
const forkable = new ForkableReplayStream<number>()const writable = new WritableStream(forkable)await fromCollection([1, 2, 3, 4, 5, 6, 7]).pipeTo(writable)
Now the stream has finished, if we fork from it we'll receive the entire events that were published to it.
await forkable.fork().pipeTo(write(console.info))// 1// 2// 3// 4// 5// 6// 7 Copy
await forkable.fork().pipeTo(write(console.info))// 1// 2// 3// 4// 5// 6// 7
Private
Optional
Protected
Generated using TypeDoc
An extension to the :class that immediately queues the entire contents of whatever has been previously consumed.
See
ForkableReplayStream:class
Example
Now the stream has finished, if we fork from it we'll receive the entire events that were published to it.