API reference / @evolu/common / Store

Store

A mutable reference for managing state with change notifications

Interfaces

InterfaceDescription
StoreA store for managing state with change notifications. Extends Ref with subscriptions. Provides methods to get, set, and modify state, and to notify listeners when the state changes.

Type Aliases

Type AliasDescription
StoreListenerA callback invoked whenever the store's state updates.
StoreSubscribeRegisters a listener for state changes, returning an unsubscribe function.
StoreUnsubscribeA function to remove a previously added listener.

Functions

FunctionDescription
createStoreCreates a store with the given initial state. The store encapsulates its state, which can be read with get and updated with set or modify. All changes are broadcast to subscribers.

Was this page helpful?