data-cap
    Preparing search index...

    Interface DataStoreController<TFields>

    The store contract the standalone runtime implements -- useSyncExternalStore-compatible without importing React.

    interface DataStoreController<TFields> {
        addPendingTransition(
            fieldsPatch: DeepPartial<TFields> | undefined,
            infoPatch: DeepPartial<DataInfo<TFields>> | undefined,
        ): symbol;
        commitAuthoritative(
            fieldsPatch: DeepPartial<TFields> | undefined,
            infoPatch: DeepPartial<DataInfo<TFields>> | undefined,
        ): void;
        getAuthoritativeState(): DataState<TFields>;
        getSnapshot(): DataState<TFields>;
        removePendingTransition(id: symbol): void;
        subscribe(listener: () => void): () => void;
    }

    Type Parameters

    • TFields

    Hierarchy (View Summary)

    Index
    • Adds a pending optimistic transition; the visible snapshot reflects it immediately.

      Parameters

      Returns symbol

    • Commits a patch directly onto authoritative state (getter/subscription- style updates, and a mutator's final settle). Always folds onto the CURRENT authoritative state, never a snapshot captured earlier.

      Parameters

      Returns void

    • Removes a pending transition by id (its operation settled, success or failure either way).

      Parameters

      • id: symbol

      Returns void

    • Registers listener to be called after every committed state change; returns an unsubscribe function.

      Parameters

      • listener: () => void

      Returns () => void