* Creates a debounced function that delays invoking the input function until after 'wait' milliseconds have elapsed * since the last time the debounced function was invoked. Useful for implementing behavior that should only happen * after the input is complete. * * @param {Function} func - T
(func, wait)
| 360 | * window.addEventListener('resize', debounce(myFunction, 200)); |
| 361 | */ |
| 362 | debounce(func, wait) { |
| 363 | let timeout; |
| 364 | return function debounced(...args) { |
| 365 | const later = () => { |
| 366 | clearTimeout(timeout); |
| 367 | func.apply(this, args); |
| 368 | }; |
| 369 | clearTimeout(timeout); |
| 370 | timeout = setTimeout(later, wait); |
| 371 | }; |
| 372 | }, |
| 373 | defineDeprecatedProperty(obj, name, getter, setter) { |
| 374 | Object.defineProperty(obj, name, { |
| 375 | get: function () { |
nothing calls this directly
no outgoing calls
no test coverage detected