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 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.