Say I have a subject somewhere in my code
mySubject$ = new Subject()
Elsewhere in the code, any number of subscriptions are made, e.g.
someSubscription = mySubject$.subscribe(() => console.log('I love streams'))
anotherSubscription = mySubject$.subscribe(() => console.log('me too!'))
When I .next()
the subject, both subscription fire as expected.
How can I hook into the rx mechanism so that I can run some code after all subscriptions have finished running their code (for that single next
event)?
Is there something like mySubject$.onAllSubscriptionsCompleted(() => console.log('all done')
Or what are alternatives to achieving this?