Small states guide fix

This commit is contained in:
Robert Jelic
2025-04-09 00:33:41 +02:00
parent c4359bc8c4
commit 6b9a490a90

View File

@@ -6,12 +6,13 @@ States provide a new way to manage data and UI synchronization in your Basalt ap
### initializeState ### initializeState
```lua ```lua
BaseFrame:initializeState("name", defaultValue, triggerRender) BaseFrame:initializeState("name", defaultValue, persistent, path?)
``` ```
Creates a new state in a BaseFrame: Creates a new state in a BaseFrame:
- `name`: Name of the state (string) - `name`: Name of the state (string)
- `defaultValue`: Initial value of the state (any type) - `defaultValue`: Initial value of the state (any type)
- `triggerRender`: Boolean that determines if changes trigger automatic re-renders - `persistent?`: Boolean that determines if the state should be stored into a file
- `path?`: The path the state should be stored to (default: states/BaseFrameNAME.state)
- Returns: self (for method chaining) - Returns: self (for method chaining)
### setState ### setState