npm.io
1.1.3 • Published 2 years ago

@types/redux-injectable-store

Licence
MIT
Version
1.1.3
Deps
1
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/redux-injectable-store

Summary

This package contains type definitions for redux-injectable-store (https://github.com/lelandrichardson/redux-injectable-store#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/redux-injectable-store.

index.d.ts

import { Reducer, ReducersMapObject, Store, StoreEnhancer } from "redux";

/**
 * An `InjectableStore` allows reducers to "inject" themselves into the store
 * at any time, for use with bundle splitting, large apps, and SPAs
 * @template S State object type.
 */
export interface InjectableStore<S> extends Store<S> {
    inject: (namespace: string, reducer: Reducer<S>, force?: boolean) => void;
    injectAll: (reducers: ReducersMapObject, force?: boolean) => void;
    clearReducers: () => void;
}

export type WrapReducer<S> = (reducer: Reducer<S>) => Reducer<S>;

/**
 * The `createInjectableStore` API follows the same API as Redux's
 * `createStore`, but with the first argument (`reducer`) missing,
 * and an optional additional last argument, `wrapReducer`.
 *
 * @template S State object type.
 */
export interface InjectableStoreCreator {
    <S>(
        preloadedState?: S,
        enhancer?: StoreEnhancer<S>,
        wrapReducer?: WrapReducer<S>,
    ): InjectableStore<S>;
}

export const createInjectableStore: InjectableStoreCreator;

Additional Details

  • Last updated: Tue, 07 Nov 2023 1536 GMT
  • Dependencies: redux

Credits

These definitions were written by Daniel Perez Alvarez.