Now that we know how to create observables, we should look at what kinds of interesting things we can do with them. In this section, we will see what it means to treat observables as sequences.
We'll start with something simple. Let's print the sum of the first five positive even integers from an observable of all integers:
(rx/subscribe (->> (Observable/interval 1 TimeUnit/MICROSECONDS) (rx/filter even?) (rx/take 5) (rx/reduce +)) prn-to-repl)
This is starting to look awfully familiar to us. We create an interval that will emit all positive integers starting at zero every one microsecond. Then, we filter all even numbers in this observable. Obviously, this is too big a list to handle, so we simply take the first five elements from it. Finally, we reduce the...