By Developers, For Developers

Historical errata for Reactive Programming with RxJS 5

PDF PgPaper PgTypeDescriptionFixed onComments
XIIITYPO

Rx.Observable.of(1,2,3).subscribe(value => {
console.log(value);
});

should be Observable.of as we are only selectively importing Observable and of

xvTYPO

Footnote number 9 on page xv of the Preface refers to URL of the previous edition.
It should instead refer to the URL of the current edition.

62ERROR

The usage of distinctUntilChanged doesn’t seem to work as described with a single argument to its callback. I found an example where two arguments are passed, and a comparison is made. e.g.

.distinctUntilChanged((p, q) => p.timestamp === q.timestamp)

1111TYPO

says this:
Here’s how we create a basic Observer from scratch:
const subscriber = Subscriber.create(
value => console.log(`Next: ${value}`),
error => console.log(`Error: ${error}`),
() => console.log(“Completed”)
);

Should say this:

Here’s how we create a basic Subscriber from scratch:
const subscriber = Subscriber.create(
value => console.log(`Next: ${value}`),
error => console.log(`Error: ${error}`),
() => console.log(“Completed”)
);

Also, code is missing from linking the Observer to the Subscriber:

observable.subscribe(subscriber);

9TYPO

Page 9 begins with a usage example of the MultipleIterator class defined on the preceding page. However, the usage example states:

const consumer = new iterateOnMultiples(…

when it should probably be:

const consumer = new MultipleIterator(…

19TYPO

The marble diagram for map() shows the derived observable timeline ending with an X, signifying an error.

This is puzzling given that the source observable’s timeline ends with a vertical line, indicating successful completion.

19SUGGEST

The code comparison between “JS Arrays” and “Observables” accompanying the marble diagram for map() makes use of variable names “upper” and “name” although the source data comprises a range of integers, which seems misleading.

Perhaps a previous version of this example used strings instead of integers for sample data.

Categories: