delay calling the given function for given delay, preventing new calls from happening while waiting
(func: () => void, delay: number)
| 541 | |
| 542 | /** delay calling the given function for given delay, preventing new calls from happening while waiting */ |
| 543 | static throttle(func: () => void, delay: number): () => void { |
| 544 | let isWaiting = false; |
| 545 | return (...args) => { |
| 546 | if (!isWaiting) { |
| 547 | isWaiting = true; |
| 548 | setTimeout(() => { func(...args); isWaiting = false; }, delay); |
| 549 | } |
| 550 | } |
| 551 | } |
| 552 | |
| 553 | static removePositioningStyles(el: HTMLElement): void { |
| 554 | const style = el.style; |
no outgoing calls
no test coverage detected