Revisiting the basics, adding errors, and complete

After having taken on the heroic feat of implementing the basics of RxJS, we hopefully feel pretty good about understanding its inner workings. So far, we have only implemented dataFn in subscribe(); there are two more callbacks in the subscribe() method that we need to implement. Let's look at a code snippet and highlight what is missing:

let stream$ = Rx.Observable.of(1,2,3);stream$.subscribe(  data => console.log(data),  err => console.error(err),  () => console.log('complete');  )

We have highlighted the two last callbacks as the missing functionality. We know from before that to trigger the error callback, we need to call observer.error('some message'). We also know that no values should ...

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.