A reactive, event-sourced state container.
Prefer `create_store` to construct one. Reducers, middleware, and
effects may also be registered at runtime.
Return the current immutable state snapshot.
The reference may change on the next commit; read once and reuse within a
computation. In development the result is a read-only proxy.
signature
get_state(): any
Return the current immutable state snapshot.
The reference may change on the next commit; read once and reuse within a
computation. In development the result is a read-only proxy.
Register a devtools/metrics observer, called once per committed event.
The observer receives an `InstrumentedEvent` synchronously after
each event's reduce phase. Observers are exception-isolated. Registering
none keeps the instrumentation path entirely off the hot path.
signature
instrument(observer): () => None
Register a devtools/metrics observer, called once per committed event.
The observer receives an `InstrumentedEvent` synchronously after
each event's reduce phase. Observers are exception-isolated. Registering
none keeps the instrumentation path entirely off the hot path.