Mark Elston (98) [Avatar] Offline
Chapter 6, page 19.

At the middle of the page, you say: " don’t want to ask for contexts if nobody is listening, so you can just share everything."

I am not sure what you are getting at here. If nobody is listening then there won't be any subscriptions at all, right? So what is the purpose of the share call?
Ivan Morgillo (1) [Avatar] Offline
Hi Mark,

when you are dealing with hot observables, as we saw in the previous chapters, values will be generated and emitted even if there is no subscriber, like a radio station passing songs even if there is no listener. The .share() operator helps you to deal with this kind of scenarios. It keeps track of how many listeners (subscribers) are currently enjoying the music and if, at some point, nobody is interested in the music (.unsubscribe()), .share() shuts everything down and the radio guy (observable) goes home.
Mark Elston (98) [Avatar] Offline
Thanks. I will re-read the section with this in mind. Somehow I lost track of the idea we were using a hot observable.