jason on Nostr: Live language devlog 2 The "once" keyword before any expression enables state ...
Live language devlog 2
The "once" keyword before any expression enables state preservation across changes. It can be arbitrarily nested and is based on the hash of the expression. So if you change the expression, it'll "reinitialize".
Notice the lines show the last evaluated value, while variables show their current value. So the lines that initialize "a" and "b" fields in the "state" variable are never re-evaluated during this video.
The "once" keyword before any expression enables state preservation across changes. It can be arbitrarily nested and is based on the hash of the expression. So if you change the expression, it'll "reinitialize".
Notice the lines show the last evaluated value, while variables show their current value. So the lines that initialize "a" and "b" fields in the "state" variable are never re-evaluated during this video.