Understanding operators
So far, we have shown how to create a stream and use some very basic operators on it to change what values get emitted. We also introduced how to inspect your stream without changing it by using the do() operator. Not all operators are as easy to understand as the map(), filter(), and do() operators. There are different tactics you can use to try to understand what each operator does so you know when to use them. Using the do() operator is one way, but there is a graphical approach you can take. This approach is known as a marble diagram. It consists of an arrow that represents time passing from left to right. There are circles, or marbles, on this arrow that represent emitted values. The marbles have a value in them, ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access