💌 I create something new each week!
Learn Reactive Programming and stay tuned.
In Lesson 1 you created a stream of toggle events. When an action is performed on the toggle (on→off or off→on), a toggle event is emitted.
You can find dozens of properties inside each of this toggle event. In particular, there is a property about the status of the toggle after the action. This is what we are looking for!
▬ isChecked is a function that accepts events from checkable elements (such as checkboxes, radio buttons, options of a menu, toggles, etc). It returns
✔ true if the element is checked,
✘ false otherwise.
Here is how it works with
Use a project 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.