Reactive statements can be used to derive computed data or trigger side effects when something changes. Statements prefixed with a $: label are reactive. They'll be recomputed when data used in the reactive statement is updated.
In this example, we'll add a toggle to show or hide completed todos.
When todos or showCompleted change, visibleTodos will be updated.
Reactive statements can also be used to trigger side effects.
Multiple statements can be grouped in a reactive block.