nested-combine-reducers
Version:
Allows you to create your root reducer in one go, instead of individually combine slice reducers
18 lines • 1.01 kB
TypeScript
import { Action, Reducer, CombinedState } from "redux";
/**
* Union of all the allowed types of a RecursiveReducersMapObject
*/
export declare type RecursiveReducersMapObjectProperty<TState = any, TAction extends Action = Action> = Reducer<TState, TAction> | RecursiveReducersMapObject<TState, TAction> | null | undefined;
/**
* A ReducersMapObject with multiple levels of nesting
*/
export declare type RecursiveReducersMapObject<TState = any, TAction extends Action = Action> = {
[Key in keyof TState]: RecursiveReducersMapObjectProperty<TState[Key], TAction>;
};
/**
* Takes a Reducers maps with multiple levels of nesting and turns it into in a single reducing function.
*
* @param map An object whose values are either reducing functions or other objects
*/
export declare function nestedCombineReducers<TState = any, TAction extends Action = Action>(map: RecursiveReducersMapObject<TState, TAction>): Reducer<CombinedState<TState>, TAction>;
//# sourceMappingURL=index.d.ts.map