Subscriptions

Let's see how we can solve the problem associated with cold observables and make a single request but distribute it to multiple subscribers with the use of a "share" and "publish" operator in RxJS.

Sometimes we don’t want to trigger the creation logic every time another part of your application wants to listen to the result.

Consider an AJAX request that fetches a user object:

let user$ = ajax('/user');

Get hands-on with 1200+ tech skills courses.