In Chapter 1, What is Reactive Programming?, we saw a brief overview of the Observer design pattern and a simple implementation of it in Clojure using watches. Here's how we did it:
In the preceding example, our observable subject is var known as numbers. The observer is the adder watch. When the observable changes, it pushes its changes to the observer synchronously.
This time around, the vector is the subject being observed and the functions processing it can be thought of as the observers. However, this works in a pull-based model. The vector doesn't push any elements down the sequence. Instead, map and friends ask the sequence for more elements. This is a synchronous operation.
Rx makes sequences and other behave like observables so that you can still map, filter, and compose them just as you would compose functions over normal sequences.