Documentation Index
Fetch the complete documentation index at: https://docs.sure-developer.com/llms.txt
Use this file to discover all available pages before exploring further.
Track
Thetrack module gives you a compact reactive state primitive inspired by signal-style APIs. A state returns a getter and setter. Effects subscribe to one or more getters and run when a subscribed state changes.
State and effect
Effects are dependency based. Updating a different state will not trigger an effect unless that state’s getter is included in the dependency list.
Tables and functional updates
When the initial value, returned value, or next value is a table, sure_lib deep-clones it at the state boundary. This prevents accidental mutation of stored state through an old table reference.API
Creates a reactive state.
stateName is used internally to connect dependencies to effects.Call the getter with no arguments to read the current value:
amount().Call the setter with a new value or a function
(currentValue) -> nextValue to update state and notify dependent effects.Registers a callback that runs when any getter in
dependencies changes.