fork
Creates a new stream from the input stream or subjection
Type
typescripttype fork = (arg$: Stream | Subjection) => Stream;
Details
- This is a stream forking operation, returning a new stream
- When the input stream unsubscribes, the new stream will also unsubscribe
- When the input stream finishes, the new stream will also finish
Difference from pipe
fork
returns a Stream
while pipe
returns a Subjection
, which means that fork
can not only subscribe to upstream streams but can also actively publish data