MCPcopy Create free account
hub / github.com/NV404/gova / StateKey

Function StateKey

state.go:183–185  ·  view source on GitHub ↗

StateKey creates or retrieves reactive state with an explicit string key. Use this only for dynamic/conditional state where call-site identity isn't stable (rare).

(s *Scope, key string, initial T)

Source from the content-addressed store, hash-verified

181// StateKey creates or retrieves reactive state with an explicit string key.
182// Use this only for dynamic/conditional state where call-site identity isn't stable (rare).
183func StateKey[T any](s *Scope, key string, initial T) *StateValue[T] {
184 return getOrCreateState(s, "key:"+key, initial)
185}
186
187// RefValue holds a mutable value that does NOT trigger re-renders.
188// Use for values that persist across renders but don't affect the view (timers, counters, refs to DOM elements).

Callers 1

PersistedStateFunction · 0.85

Calls 1

getOrCreateStateFunction · 0.85

Tested by

no test coverage detected