Last active
March 16, 2019 12:51
-
-
Save Krasnov8953/a1ce70c45b23859f5e26c35f62bd949b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const debounce = (callback, delay) => { | |
let timerId; | |
return (...args) => { | |
timerId && clearTimeout(timerId); | |
timerId = setTimeout( | |
() => callback(...args), | |
delay | |
); | |
} | |
}; | |
let delayProcess = debounce(process, 400); | |
$(window).resize(delayProcess); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment