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

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

Added visualizations

  • Property mode set to 100644
File size: 399 bytes
Line 
1'use strict';
2
3Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
5const debounce = require('./debounce.js');
6
7function throttle(func, throttleMs = 0, options = {}) {
8 const { leading = true, trailing = true } = options;
9 return debounce.debounce(func, throttleMs, {
10 leading,
11 maxWait: throttleMs,
12 trailing,
13 });
14}
15
16exports.throttle = throttle;
Note: See TracBrowser for help on using the repository browser.