123456789101112131415 |
- const debounce = (func, delay) => {
- let inDebounce
- return function () {
- const context = this
- const args = arguments
- clearTimeout(inDebounce)
- inDebounce = setTimeout(() => func.apply(context, args), delay)
- }
- }
- export default debounce
|