Chapter 6. Controlling the observer-observable relationship
This chapter covers
- Creating observers without a fuss
- Controlling the length of the observer/observable relationship
- Adding and controlling side effects in the pipeline
Imagine you’re a singer with the most beautiful voice, the greatest lyrics, and the best performance moves. It doesn’t pay to be such a singer if you have no listeners. The same goes for observables; they sit there, doing nothing and wasting resources, if there’s no observer to subscribe to and receive their notifications. It’s also interesting to think about when the relationship between the singer and the listener begins and ends, especially if the music is coming from an album, and the listener can skip tracks ...