Need help?
Ask a question or report a problem on GitHub.
Open an issue
State and reactivity
Keep values that change in state, describe what is derived from them, and react when they change.
Otter
state clicks is 0 derive doubled is clicks * 2 when clicks changes say "clicks is now" clicks . clicks is 1 clicks is 1 clicks is 2 say "doubled:" doubled
state declares a value. derive defines a value computed from other values and updates when they do. when X changes runs only when the value actually changes, so in the console this prints clicks is now 1, clicks is now 2 and doubled: 4. A program's first lines already run when it starts, so no separate start block is needed.
on start, on close and memo are not part of Otter 1.0. on start and on close stop the program with an error saying they are not supported in Otter 1.0, and memo is not accepted at all.
Next: Windows applications