@maherunlocker/custom-react-table
Version:
dynamic table based on react table v7
20 lines • 599 B
JavaScript
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