You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
535 B
23 lines
535 B
2 years ago
|
type DependencyList = ReadonlyArray<any>;
|
||
|
|
||
|
declare function useMemoOne<T>(
|
||
|
// getResult changes on every call,
|
||
|
getResult: () => T,
|
||
|
// the inputs array changes on every call
|
||
|
inputs: DependencyList | undefined,
|
||
|
): T;
|
||
|
|
||
|
declare function useCallbackOne<T extends (...args: any[]) => any>(
|
||
|
// getResult changes on every call,
|
||
|
callback: T,
|
||
|
// the inputs array changes on every call
|
||
|
inputs: DependencyList | undefined,
|
||
|
): T;
|
||
|
|
||
|
export {
|
||
|
useMemoOne,
|
||
|
useCallbackOne,
|
||
|
useMemoOne as useMemo,
|
||
|
useCallbackOne as useCallback
|
||
|
};
|