id | compareWith | video | compare | lesson | title | layout | class | preview_image | preview_image_alt | |
---|---|---|---|---|---|---|---|---|---|---|
map |
filter |
238067754 |
|
2 |
Map and the immutability principle |
default |
post |
map/content_preview.jpg |
Map reactive operator and immutability |
❚ map
and all the other reactive programming functions will never modify the input stream. Instead, they return a new stream. This principle is called immutability.
In the video example, ▬ isChecked
is used as a project function. This function accepts events from checkable elements: checkboxes, radio buttons, options of a menu, toggles, etc. It returns ✔ true
if the element is checked, ✘ false
otherwise.
When an action is performed on the toggle (on→off or off→on), a toggle event is emitted (read a stream of toggle events).