But redux-observable sponsors observing midway! Not at the edges. When you do .mergeMap(() => getJSON()) it’s the .mergeMap that subscribes (hence observing) to the observable, not the edge of the system.
But redux-observable sponsors observing midway!
Luca Matteis
1

That can only happen when the main stream is observed in the first place. The creation of the stream originally does produce the subscription, it just declares that a subscription should occur here. We’re not literally calling subscribe on the getJSOn’d observable. We’re not even literally creating the getJSON stream at the time the function is called. The subscription you’re referencing in the middle is a declaration of that subscription, not the literal code that does the subscribing.

All the function does is create the stream; the stream is a declaration of what should happen in response to inputs. None of those things happen until that stream has been observed.

Like what you read? Give James DiGioia a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.