Last active
December 29, 2015 22:59
-
-
Save imbcmdth/7739618 to your computer and use it in GitHub Desktop.
later function
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
var later = Function.bind.bind(window.setTimeout, window); | |
// Usage | |
element.addEventListener('click', later(foo, 1000)); | |
// On click, `foo` will be executed after 1 second with the usual event parameters passed along |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment