A store handle with a known state shape.

Returned by each client's own store factory so that internal code gets full typing on getState() and dispatch(). Assignable to SdkStore for hand-off to another client.

interface SdkStoreHandle<S extends object = Record<string, unknown>> {
    dynamicMiddleware: DynamicMiddleware;
    extra: SdkStoreRegistry;
    rootReducer: InjectableRootReducer & Reducer<S>;
    store: Store<S, UnknownAction, unknown> & {
        dispatch: ThunkDispatch<S, SdkStoreRegistry, UnknownAction>;
    };
}

Type Parameters

  • S extends object = Record<string, unknown>

Hierarchy (View Summary)

Properties

dynamicMiddleware: DynamicMiddleware
rootReducer: InjectableRootReducer & Reducer<S>
store: Store<S, UnknownAction, unknown> & {
    dispatch: ThunkDispatch<S, SdkStoreRegistry, UnknownAction>;
}

dispatch keeps RTK's thunk typing so clients can await the result of endpoint.initiate(...) exactly as they would on a store they built themselves.