UNPKG

@wordpress/compose

Version:
20 lines (19 loc) 475 B
// packages/compose/src/utils/throttle/index.ts import { debounce } from "../debounce"; var throttle = (func, wait, options) => { let leading = true; let trailing = true; if (options) { leading = "leading" in options ? !!options.leading : leading; trailing = "trailing" in options ? !!options.trailing : trailing; } return debounce(func, wait, { leading, trailing, maxWait: wait }); }; export { throttle }; //# sourceMappingURL=index.js.map