9 Streams programming

This chapter covers

  • Reviewing the Iterator/Iterable protocols
  • Using generators to represent iterable sequences of values over time
  • Reviewing the push/pull models as well as stream-based programming
  • Using observables to create declarative, asynchronous push streams

An Observable is a function that takes an observer and returns a function. Nothing more, nothing less. If you write a function that takes an observer and returns a function, is it async or sync? Neither. It’s a function.

—Ben Lesh

This last chapter brings together the most important techniques covered in this book, including composable software as a whole, functional programming, mixin extensions, and reflective and asynchronous programming. Here, you’ll learn ...

Get The Joy of JavaScript 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.