Documentation
¶
Overview ¶
Package state provides page-level shared state management with dot-path access and subscription-based change notification.
Index ¶
- type Store
- func (s *Store) AsContext() map[string]any
- func (s *Store) Get(path string) (any, bool)
- func (s *Store) Load(initial map[string]any)
- func (s *Store) Set(path string, value any)
- func (s *Store) Snapshot() map[string]any
- func (s *Store) Subscribe(pathPrefix string, fn func(key string, value any)) func()
- func (s *Store) Toggle(path string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a concurrency-safe key-value store with dot-path access.
func (*Store) AsContext ¶
AsContext returns the values map for use as an expression context. The returned map is the live reference (caller must hold no write lock).
func (*Store) Set ¶
Set writes a value at the given dot-path, creating intermediate maps as needed. Notifies all matching watchers.
Click to show internal directories.
Click to hide internal directories.