November 2019
Beginner
804 pages
20h 1m
English
Creating observables is only half the battle. Having a data source is one thing, but if nobody observes, listens, or watches, then it is pretty much useless. As a matter of fact, an observable will only be executed if there is at least one observer.
With RxJS, each subscriber is called Observer. These are listeners for the values emitted/produced by Observable.
Here's a basic example:
const observer = {
next: (x:any) => console.log(`Observer got a next value: ${x}`),
error: (err:any) => console.error(`Observer got an error: ${err}`),
complete: () => console.log('Observer got a completion notification')
};
Here, the observer object is a valid observer. As illustrated in the preceding code block, it should have three ...
Read now
Unlock full access