Created
April 19, 2019 15:39
-
-
Save SergioLaRosa/d9c3635845145bcbbb074ad264ab25b6 to your computer and use it in GitHub Desktop.
A better setTimeout
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
| //credits to: https://ilinkuo.wordpress.com/2014/01/05/a-better-settimeout/ | |
| function setTimeout3(callback, delay){ | |
| var handle = new Number(setTimeout(callback, delay)); | |
| handle.clear = function(){clearTimeout(handle);}; | |
| return handle; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment