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 function equals < T > ( a , b ) { if ( isImmutable ( a ) && isImmutable ( b ) ) { return a . equals ( b ) ; } return a === b ; } export type Immutable = { equals ( b ) : boolean ; } ; export function isImmutable ( a ) { return ( ! ! a && typeof a === 'object' && ( '@@__IMMUTABLE_ITERABLE__@@' in a || '@@__IMMUTABLE_RECORD__@@' in a ) ) ; } export function getDisplayName < T > ( Component ) { return Component . displayName || Component . name || 'Component' ; } export function keys < O extends object > ( o ) { return Object . keys ( o ) as any ; } export function mapValues < O extends object , K extends keyof O , T > ( o , f ) { let result = { } as any ; keys ( o ) . forEach ( k => ( result [ k ] = f ( o [ k ] as any , k as any ) ) ) ; return result ; } export function some < O extends object > ( o , f ) { return keys ( o ) . some ( k => f ( o [ k ] , k ) ) ; }