UNPKG

undux

Version:

Dead simple state management for React

19 lines (18 loc) 864 B
import { ComponentType } from 'react'; export type Diff<T, U> = Pick<T, Exclude<keyof T, keyof U>>; /** * TODO: Avoid diffing by passing individual values into a React component * rather than the whole `store`, and letting React and `shouldComponentUpdate` * handle diffing for us. */ export declare function equals<T>(a: T, b: T): boolean; export type Immutable = { equals(b: any): boolean; }; export declare function isImmutable(a: any): a is Immutable; export declare function getDisplayName<T>(Component: ComponentType<T>): string; export declare function keys<O extends object>(o: O): (keyof O)[]; export declare function mapValues<O extends object, K extends keyof O, T>(o: O, f: (value: O[K], key: K) => T): { [K in keyof O]: T; }; export declare function some<O extends object>(o: O, f: <K extends keyof O>(v: O[K], k: K) => boolean): boolean;