@wix/design-system
Version:
@wix/design-system
11 lines • 535 B
TypeScript
type Fn<ARGS extends any[], R> = (...args: ARGS) => R;
/**
* A hook that returns a stable callback that always has the latest version of the provided function.
* Taken from https://github.com/Volune/use-event-callback/blob/master/src/index.ts
*
* @param {Fn<ARGS, R>} fn - The callback function.
* @returns {Fn<ARGS, R>} A stable version of the provided callback function.
*/
export declare const useEventCallback: <ARGS extends any[], R>(fn: Fn<ARGS, R>) => Fn<ARGS, R>;
export {};
//# sourceMappingURL=useEventCallback.d.ts.map