Cédric Soulas
Motion graphics about programming

 

Episode 6 - Projection vs Filtering Monday, 23 Oct.

With the previous lessons, you have performed four different kinds of operations on streams. You have learned how to:

If you still don’t know about streams, immutability and reactivity, then you should start with Lesson 1.

There is a fifth important kind of operation yet to discover: filtering streams.

For this lesson, we need a new piece: ▬ isEven. It’s a function that accepts a number as an argument, then:

Please take this new card, ❚ filter, and the ❚ map card you received in Lesson 2. Both cards can use the ▬ isEven function as an argument.

We set the same function and the same input stream of numbers on those cards and compare the stream they return:

I’ll frequently re-use previous cards, in different context, with different arguments and in comparison with new ones. Through repetitions, reactive programming will eventually become second nature for you.

▬ isEven is used as:

A predicate returns ✔ true or ✘ false. This is how ❚ filter works with a predicate:

So, you now know three reactive programming concepts and five kinds of stream operation! That’s something, you can celebrate. And still, there are more. More categories. More cards per category. More Monday lessons 😁.

Animated cards to learn Reactive Programming

Focus on one new concept every week with a 20 seconds gif

Occasional updates, plus:
Cédric Soulas
Motion graphics about programming