@supunlakmal/hooks
Version:
A collection of reusable React hooks
8 lines (7 loc) • 370 B
TypeScript
/**
* Hook that triggers a callback when the user's mouse cursor leaves the viewport area.
*
* @param {() => void} onPageLeave The callback function to execute when the mouse leaves the page.
* @param {boolean} [enabled=true] Optional boolean to enable or disable the hook.
*/
export declare function usePageLeave(onPageLeave: () => void, enabled?: boolean): void;