Last active
April 22, 2016 15:43
-
-
Save sairion/01b1069c7b02db6f074ebe116f411b1e to your computer and use it in GitHub Desktop.
keyboard event type (i.e. keyword-based recommendation)
This file contains 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
export function debounceUntilTimeout(fun, delay, context = null) { | |
var timer; | |
return function delayedFunctionWrapper(...args) { | |
clearTimeout(timer); | |
args.unshift(context); | |
timer = setTimeout(fun.bind.apply(fun, args), delay); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment