Skip to content

Instantly share code, notes, and snippets.

View enishant's full-sized avatar

Nishant Vaity enishant

View GitHub Profile
@ramonvictor
ramonvictor / wait-function.js
Created April 23, 2016 16:05
Fancy setTimeout wrapper using native Promise.
var wait = function(ms) {
ms = ms || 500;
return new Promise(function(resolve, reject){
window.setTimeout(function() {
resolve();
}, ms);
});
};
// USAGE