Reference
@reckona/mreact-store
25 public exports.
Function
FunctioncreateRequestStoreFactory
function createRequestStoreFactory<T>(initial: (): T, options?: StoreOptions<T>): (): Store<T>Creates a factory for per-request stores from an initial-state callback. Use this when SSR or server actions need isolated store instances instead of sharing process-global state.FunctioncreateStorefunction createStore<T>(initial: T, options: StoreOptions<T>): Store<T>Creates a reactive object store with patch updates, replacement, transactions, selectors, subscriptions, and optional instrumentation. The store keeps state in a `ReadonlyCell`; selectors should be disposed when their consumer scope ends.FunctionpersistedStoreStatefunction persistedStoreState<T>(state: T, version: number): StorePersistedState<T>Creates an unambiguous versioned persistence record for Store.load().FunctionshallowEqualfunction shallowEqual<T>(left: T, right: T): booleanCompares two plain objects by own enumerable keys with `Object.is` value equality.Interface
InterfaceLegacyStorePersistedState
interface LegacyStorePersistedStateRepresents the deprecated untagged persistence envelope accepted only with explicit opt-in.InterfaceSelectedCellinterface SelectedCellRepresents a selected reactive value that can be disposed manually.InterfaceStoreinterface StoreProvides reactive state access, updates, transactions, selectors, and subscriptions.InterfaceStoreCurrentPersistOptionsinterface StoreCurrentPersistOptionsConfigures raw or tagged persistence records without legacy envelope inference.InterfaceStoreInstrumentationEventinterface StoreInstrumentationEventDescribes one store instrumentation event emitted after a state change.InterfaceStoreLegacyPersistOptionsinterface StoreLegacyPersistOptionsConfigures persistence with explicit support for deprecated untagged envelopes.InterfaceStoreOptionsinterface StoreOptionsConfigures store instrumentation and persistence hooks.InterfaceStorePersistBaseOptionsinterface StorePersistBaseOptionsConfigures persistence behavior shared by current and legacy record contracts.InterfaceStorePersistedStateinterface StorePersistedStateInterfaceStorePersistenceinterface StorePersistenceInterfaceStorePersistenceFailureinterface StorePersistenceFailureDescribes an observable persistence failure.Type Alias
Type AliasStoreEquality
type StoreEquality = (left: T, right: T): booleanCompares selected store values to decide whether subscribers should update.Type AliasStoreHydrationConflicttype StoreHydrationConflict = "merge" | "preserve-local" | "replace" | (loaded: T, current: T): TControls how hydration resolves a loaded value after local state has changed.Type AliasStoreListenertype StoreListener = (state: T, previous: T): voidReceives the next and previous store state after a committed change.Type AliasStorePatchtype StorePatch = Partial<T>Represents a partial object patch applied to store state.Type AliasStorePersisttype StorePersist = (state: T): void | Promise<void> | StorePersistOptions<T>Type AliasStorePersistenceFailurePhasetype StorePersistenceFailurePhase = "load" | "migrate" | "save"Identifies the persistence operation that failed.Type AliasStorePersistenceStatustype StorePersistenceStatus = "hydrating" | "ready" | "error"Type AliasStorePersistOptionstype StorePersistOptions = StoreCurrentPersistOptions<T> | StoreLegacyPersistOptions<T>Configures store persistence with an explicit current or legacy record contract.Type AliasStoreReplacertype StoreReplacer = T | (previous: T): TProvides either a replacement object or a replacement-producing updater callback.Type AliasStoreSettertype StoreSetter = StorePatch<T> | (previous: T): StorePatch<T> | TProvides either a patch object or a patch-producing updater callback.