/**
 * Inlined from https://github.com/alexreardon/memoize-one
 */ export type EqualityFn = ( newArgs : any [ ] , lastArgs : any [ ] ) => boolean ; export default function memoizeOne < ResultFn extends ( this : any , ... newArgs : any [ ] ) => ReturnType < ResultFn > > ( resultFn , isEqual ) { let lastThis ; let lastArgs = [ ] ; let lastResult ; let calledOnce = false ; function memoized ( this , ... newArgs ) { if ( calledOnce && lastThis === this && isEqual ( newArgs , lastArgs ) ) { return lastResult ; } lastResult = resultFn . apply ( this , newArgs ) ; calledOnce = true ; lastThis = this ; lastArgs = newArgs ; return lastResult ; } return memoized as ResultFn ; }