Highlighting Multicasting operators
There are many useful RxJS operators for Multicasting (or sharing values/executions) in RxJS 6, namely, multicast
, publish
, share
, shareReplay
, publishReplay
, publishLast
, and refcount
. For more details about these operators, you can check the official docs: https://rxjs.dev/api/operators.
In version 7, Multicasting operators were consolidated to share
, connectable
, and connect
. The other Multicasting APIs are now deprecated and will be deleted in RxJS 8. The only operator that wasn't deprecated is shareReplay
because it is very popular. It is now a wrapper around the highly configurable share
operator.
Since we are using RxJS 7 in this book, I think it is useless to go through all the deprecated operators. We will instead focus on the share
operator, as it satisfies most cases. We will learn the behavior of the share
operator by considering a real-world use case in the next chapter, Chapter 9, Caching Streams.
Note
For more details...