Lesson 33. Observables

After reading lesson 33, you will be able to

  • Create your own observables
  • Subscribe to observables
  • Compose new observables with higher-order combinator functions
  • Create your own combinator functions for composing observables

Observables are objects in which you can subscribe to streams of data. Observables are like promises, but whereas a promise only resolves or rejects once, an observable can keep emitting new values indefinitely. If you were to think of promises as an asynchronous datum that you can wrap around setTimeout, observables would be the asynchronous data that you can wrap around setInterval.

Note

In order to use observables today, at the time of this writing, you need to use one of the open ...

Get Get Programming with JavaScript Next: New features of ECMAScript 2015, 2016, and beyond now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.