Wrapping Up

We’ve built an entire game for the browser using only Observables, and along the way we’ve seen several extremely convenient methods to handle concurrency and to compose and transform Observables. This is one of the strengths of RxJS: there is always a method to help with the problem you’re trying to tackle. Feel free to explore them in the RxJS documentation.[18]

Reactive programming makes it easy to write concurrent programs. The Observable abstraction and the powerful RxJS methods make it natural for different parts of a program to interact efficiently. Programming without relying on external state might take some getting used to, but it has enormous benefits. We can encapsulate entire behaviors in a single Observable pipeline, ...

Get Reactive Programming with RxJS 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.