redux-detector
Version:
Redux enhancer for pure detection of state changes.
13 lines (12 loc) • 609 B
TypeScript
/**
* Function that reduces previous and next state to single value.
*/
export declare type Detector<TState = any, TResult = any> = (prevState: TState | undefined, nextState: TState | undefined) => TResult;
/**
* Function that compares previous and next state and can return action, array of actions or nothing.
*/
export declare type ActionsDetector<TState = any, TAction = any> = Detector<TState, TAction | TAction[] | void>;
/**
* Function that compares previous and next state and returns boolean value
*/
export declare type ConditionDetector<TState = any> = Detector<TState, boolean>;