UNPKG

paxjs-promise

Version:
1 lines 369 B
Promise&&(Promise.delay=function(o,n){return void 0===o||o<0?Promise.resolve(n):n instanceof Promise?n.then(function(n){return new Promise(function(e){setTimeout(e,o,n)})}):new Promise(function(e){setTimeout(e,o,n)})},Promise.prototype.delay=function(o){return this.then(function(n){return void 0===o||o<0?n:new Promise(function(e){setTimeout(function(){e(n)},o)})})});