|
|
|
|
|
by richeyryan
2011 days ago
|
|
You could have an atom that holds the state and a function which can update that atom. You might do something like the elm architecture where you pass a message to a reducer which produces the new state that the atom is set to. All the logic is contained in the reducer and is pure and immutable and the state change happens at a single controlled point. |
|
Thanks, TIL! That's equivalent to the "mostly functional" style that's doable in Common Lisp.