UNPKG

redux-saga-tools

Version:

A set of utility functions to write saga and reducers easily

13 lines (12 loc) 896 B
import { ById } from './by-id'; export declare function createReducer(initialState: any, handlers: any): (state: any, action: any) => any; export declare function reduceById<T>(array?: any[]): ById<T>; export declare function toArray<T>(byId: ById<T>): T[]; export declare function ids(object?: any): string[]; export declare function setById<T>(state?: any, byId?: ById<T>): any; export declare function filterById<T>(byId?: ById<T>, itemIds?: string[]): ById<T>; export declare function filterToArrayById<T>(byId?: ById<T>, itemIds?: string[]): T[]; export declare function unique(array?: any[]): string[]; export declare function uniqueProps(array?: any[], property?: string): string[]; export declare function uniquePropsById(byId?: ById<any>, property?: string): string[]; export declare function missingIds<T>(byId?: ById<T>, objectIds?: Array<string | undefined>): (string | undefined)[];