Last active
May 20, 2019 09:14
-
-
Save sukima/db556aa51fde15b7d37c to your computer and use it in GitHub Desktop.
Simple jQuery $.delay promise snippit
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
jQuery.delay = function(ms, value) { | |
var defer = new jQuery.Deferred(); | |
setTimeout(function() { defer.resolve(value); }, ms || 0); | |
return defer.promise(); | |
}; |
codeskyblue
commented
May 20, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment