Update to v13 and add queue and completely change code
This commit is contained in:
parent
dcef23d0ed
commit
55a38726a3
6706 changed files with 424137 additions and 61608 deletions
3
node_modules/timers-ext/promise/.eslintrc.json
generated
vendored
Normal file
3
node_modules/timers-ext/promise/.eslintrc.json
generated
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"globals": { "Promise": true }
|
||||
}
|
21
node_modules/timers-ext/promise/sleep.js
generated
vendored
Normal file
21
node_modules/timers-ext/promise/sleep.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
"use strict";
|
||||
|
||||
var isValue = require("es5-ext/object/is-value")
|
||||
, isPromise = require("es5-ext/object/is-promise")
|
||||
, nextTick = require("next-tick")
|
||||
, ensureTimeout = require("../valid-timeout");
|
||||
|
||||
module.exports = function (/* timeout */) {
|
||||
var Constructor = isPromise(this) ? this.constructor : Promise;
|
||||
var timeout = arguments[0];
|
||||
if (isValue(timeout)) timeout = ensureTimeout(timeout);
|
||||
return new Constructor(function (resolve) {
|
||||
if (isValue(timeout)) {
|
||||
setTimeout(function () {
|
||||
resolve();
|
||||
}, timeout);
|
||||
} else {
|
||||
nextTick(resolve);
|
||||
}
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue