📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-06-30 19:58:38
📂
/ (Root)
/
home
/
orkouolp
/
nodevenv
/
node_js
/
orkofarms.com
/
18
/
lib
/
node_modules
/
axios
/
lib
/
helpers
📍 /home/orkouolp/nodevenv/node_js/orkofarms.com/18/lib/node_modules/axios/lib/helpers
🔄 Refresh
✏️
Editing: throttle.js
Writable
'use strict'; /** * Throttle decorator * @param {Function} fn * @param {Number} freq * @return {Function} */ function throttle(fn, freq) { let timestamp = 0; const threshold = 1000 / freq; let timer = null; return function throttled() { const force = this === true; const now = Date.now(); if (force || now - timestamp > threshold) { if (timer) { clearTimeout(timer); timer = null; } timestamp = now; return fn.apply(null, arguments); } if (!timer) { timer = setTimeout(() => { timer = null; timestamp = Date.now(); return fn.apply(null, arguments); }, threshold - (now - timestamp)); } }; } export default throttle;
💾 Save Changes
❌ Cancel