Basically, Stream Teeing

By design, streams work on the principle of one source, one consumer. So if you have a stream that you'd like to be consumed by two consumers, you need help. Enter Teeing.

Also known as forking streams, teeing refers to splitting one stream into two identical streams to be read by two distinct readers. It's pretty cool.

Under the hood, tee() locks the source stream to the fork, creating two identical, unlocked streams ready for consumption.

Below is an example that, from a source stream that supplies employees in the shape of:

{ id: 1, name: "Something somethington" }
This stream is teed to two different streams: the `leftColumnStream` and the `rightColumnStream`.

To read from these split streams, press the correponding button. It's that simple!

Don't forget to check out the source code!

      More Examples 🎉

      Further Reading: WhatWG Spec