ProtectedconstructorThe state to start from.
Adopt a state produced on the server.
Merged over the initial state rather than replacing it, so a snapshot written by an older release that lacks a newly added key hydrates into a usable state instead of an incomplete one.
The state read from the snapshot.
Put the state back to what it was created with.
Read a derived value now.
Reads the value out of the state.
The value.
Commit a change, merging a partial state.
The next partial state, or a function of the current one.
Watch every change.
Called after each committed change.
The function that stops watching.
Watch a derived value, notified only when it actually changes.
Reads the value out of the state.
Called with the new and previous value.
How to compare, reference equality by default.
The function that stops watching.
StaticcreateCreate a store.
The state to start from, and to return to on reset.
A new store.
A store: application state written once, read by any view engine.
Named
StateStoreso the bareStorename belongs to the activation decorator, the same rule that givesCacheManager,RealtimeManagerandI18nManagertheir suffixes. Nobody writes this name often: stores are declared withdefineStoreor@Store().It knows nothing of React, Vue, Svelte, the DOM or Node. That is what lets the same state layer run during server rendering, in the browser and in React Native, which is the continuum applied to state rather than to requests.
Created through defineStore or the
@Store()decorator; resolved from the container, so a component reaches it withuseContainer()and a service takes it through its constructor.