STATE gives you reactive references to state keys through attribute access. STATE.count is equivalent to Rx("count") — it creates an Rx reference without needing to declare one separately.
With set_initial_state
The return value ofset_initial_state() is a bound state proxy that validates attribute access against the keys you declared. This catches typos at definition time rather than at runtime:
STATE global skips validation, which is useful for keys created dynamically by form controls or actions:
Dot Paths
Attribute access chains naturally. Each. adds a path segment to the expression:
Import
set_initial_state(), which is the recommended approach when you’re declaring initial state.