useEventListener
.
Installation
npx sse-tool add use-event-listener
npm install sse-hooks
Usage
import { useEventListener } from "./{hooks file}";
// See usage example in source
import { useEventListener } from "sse-hooks";
// See usage example in source
API
Parameters
| Name | Type | Description |
| :-------- | :---------- | :----------------------- | --- |
| eventName | K | |
| handler | Function | |
| element | RefObject | |
| options | boolean | AddEventListenerOptions | |
Changelog
81e9f — feat: update documentation and categorize hooks
c165d — feat: enhance useRoleGuard and useSSR hooks with additional options and documentation
30da4 — feat: add new hooks and their metadata
cf13e — feat: add custom hooks for step navigation, ternary dark mode, timeout, toggle, unmount, and window size