November 2019
Beginner
804 pages
20h 1m
English
To register an observer with Observable, you have to call its .subscribe(...) method and pass your observer as an argument. In return, you'll get a Subscription object, which you can use to cancel the subscription once you are not interested anymore:
import { of } from 'rxjs';
const myObservable = of(1,3,3,7);
const mySubscription = myObservable.subscribe(x => console.log(x));
...
mySubscription.unsubscribe();
When you subscribe to Observable, you actually create an execution of it. This is an important ...
Read now
Unlock full access