source: node_modules/es-toolkit/dist/compat/function/throttle.mjs

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 293 bytes
Line 
1import { debounce } from './debounce.mjs';
2
3function throttle(func, throttleMs = 0, options = {}) {
4 const { leading = true, trailing = true } = options;
5 return debounce(func, throttleMs, {
6 leading,
7 maxWait: throttleMs,
8 trailing,
9 });
10}
11
12export { throttle };
Note: See TracBrowser for help on using the repository browser.