(func, wait)
| 570 | // ============================================ |
| 571 | |
| 572 | function debounce(func, wait) { |
| 573 | let timeout; |
| 574 | return function executedFunction(...args) { |
| 575 | const later = () => { |
| 576 | clearTimeout(timeout); |
| 577 | func(...args); |
| 578 | }; |
| 579 | clearTimeout(timeout); |
| 580 | timeout = setTimeout(later, wait); |
| 581 | }; |
| 582 | } |
| 583 | |
| 584 | function throttle(func, limit) { |
| 585 | let inThrottle; |
no outgoing calls
no test coverage detected