Add deferPromise function (#626)
This commit is contained in:
parent
0a6c08d0f5
commit
51981f0c4e
@ -99,6 +99,7 @@
|
|||||||
"getSetIntersection": "readonly",
|
"getSetIntersection": "readonly",
|
||||||
"getSetDifference": "readonly",
|
"getSetDifference": "readonly",
|
||||||
"escapeRegExp": "readonly",
|
"escapeRegExp": "readonly",
|
||||||
|
"deferPromise": "readonly",
|
||||||
"EventDispatcher": "readonly",
|
"EventDispatcher": "readonly",
|
||||||
"EventListenerCollection": "readonly",
|
"EventListenerCollection": "readonly",
|
||||||
"EXTENSION_IS_BROWSER_EDGE": "readonly"
|
"EXTENSION_IS_BROWSER_EDGE": "readonly"
|
||||||
|
@ -203,6 +203,16 @@ function promiseTimeout(delay, resolveValue) {
|
|||||||
return promise;
|
return promise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function deferPromise() {
|
||||||
|
let resolve;
|
||||||
|
let reject;
|
||||||
|
const promise = new Promise((resolve2, reject2) => {
|
||||||
|
resolve = resolve2;
|
||||||
|
reject = reject2;
|
||||||
|
});
|
||||||
|
return {promise, resolve, reject};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Common events
|
* Common events
|
||||||
|
Loading…
Reference in New Issue
Block a user