Episode 5 - Two input streams. One output. Monday, 16 Oct.
- Creating streams with fromEvent
- Transforming streams with map, which projects events through a function
- Time-shifting streams with delay, which projects events through time
Today I present a fourth kind of operation: combining streams. Look at this card:
It only accepts input streams as arguments. This is how
❚ merge operates with two (or more) input streams:
- It interleaves the events of multiple input streams
- As a result, it returns a single stream of interleaved events
As you can see, it doesn’t change the event values or the arrival times. No projection through a function. No projection through time. You’ll see in future lessons that other cards from the combining streams category can change event values and/or arrival times.
This is the first time in this course you’ve worked with two input streams. Cool! I’ll show you next Monday a fifth kind of stream operation.