/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-b67433b | Cube Dev Team */
import { useSyncRef } from "./use-sync-ref.js";
import { useCallback } from "react";

//#region src/_internal/hooks/use-event.ts
/**
* useEvent shim from the latest React RFC.
*
* @see https://github.com/reactjs/rfcs/pull/220
* @see https://github.com/reactjs/rfcs/blob/useevent/text/0000-useevent.md#internal-implementation
*/
function useEvent(callback) {
	const callbackRef = useSyncRef(callback);
	return useCallback((...args) => callbackRef.current(...args), []);
}

//#endregion
export { useEvent };
//# sourceMappingURL=use-event.js.map