Reference
@reckona/mreact-store
12 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.FunctionshallowEqualfunction shallowEqual<T>(left: T, right: T): booleanCompares two plain objects by own enumerable keys with `Object.is` value equality.Interface
InterfaceSelectedCell
interface SelectedCellRepresents a selected reactive value that can be disposed manually.InterfaceStoreinterface StoreProvides reactive state access, updates, transactions, selectors, and subscriptions.InterfaceStoreInstrumentationEventinterface StoreInstrumentationEventDescribes one store instrumentation event emitted after a state change.InterfaceStoreOptionsinterface StoreOptionsConfigures store instrumentation and persistence hooks.Type Alias
Type AliasStoreEquality
type StoreEquality = (left: T, right: T): booleanCompares selected store values to decide whether subscribers should update.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 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.