UNPKG

512 BTypeScriptView Raw
1export declare type EqualityFn<TFunc extends (...args: any[]) => any> = (newArgs: Parameters<TFunc>, lastArgs: Parameters<TFunc>) => boolean;
2export declare type MemoizedFn<TFunc extends (this: any, ...args: any[]) => any> = {
3 clear: () => void;
4 (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>): ReturnType<TFunc>;
5};
6declare function memoizeOne<TFunc extends (this: any, ...newArgs: any[]) => any>(resultFn: TFunc, isEqual?: EqualityFn<TFunc>): MemoizedFn<TFunc>;
7export default memoizeOne;