Using a Subscription

Let's see what subscription means to an observable and how to merge multiple subscriptions in RxJS.

Subscription

There’s one more vocabulary word before this chapter is over: subscription.

While piping through an operator returns an observable:

let someNewObservable$ = anObservable$.pipe(
  map(x => x * 2)
);

A call to .subscribe returns a Subscription:

let aSubscription = someNewObservable$.subscribe(console.log);

Get hands-on with 1200+ tech skills courses.