Cédric Soulas
Motion graphics about programming

 

Episode 2 - Immutability Monday, 25 Sept.

Last Monday you created a stream of toggle events. When an action was performed on the toggle (on→off or off→on), an event box was emitted.

You can find dozens of properties inside each box. In particular, a box contains a property about the status of the toggle after the action. This is what we are looking for!

Today I’m happy to hand you:

▬ isChecked accepts events from checkable elements (such as checkboxes, radio buttons, options of a menu, toggles, etc). It returns if the element is checked, otherwise. Here is how it works with ❚ map:

Use a projection function on this card, such as ▬ isChecked. Then, this is how ❚ map operates:

A card never modifies the input stream. Instead, it returns a new stream. This principle is called immutability.

Summary

Awesome!

In your collection, you now have:

Next Monday we’ll start building a little machine by assembling several cards together. See you!

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