UNPKG

@maherunlocker/custom-react-table

Version:
20 lines 599 B
import { debounce } from 'lodash'; // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types export const useManyClickHandlers = (...handlers) => { const callEventHandler = (e) => { if (e.detail <= 0) return; const handler = handlers[e.detail - 1]; if (handler) { handler(e); } }; const debounceHandler = debounce((e) => { callEventHandler(e); }, 250); return (e) => { e.persist(); debounceHandler(e); }; }; //# sourceMappingURL=useManyClickHandlers.js.map