aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.eslintrc.json1
-rw-r--r--ext/mixed/js/core.js10
2 files changed, 11 insertions, 0 deletions
diff --git a/.eslintrc.json b/.eslintrc.json
index 3e384524..68b840f8 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -99,6 +99,7 @@
"getSetIntersection": "readonly",
"getSetDifference": "readonly",
"escapeRegExp": "readonly",
+ "deferPromise": "readonly",
"EventDispatcher": "readonly",
"EventListenerCollection": "readonly",
"EXTENSION_IS_BROWSER_EDGE": "readonly"
diff --git a/ext/mixed/js/core.js b/ext/mixed/js/core.js
index bf877e72..0fe5ea20 100644
--- a/ext/mixed/js/core.js
+++ b/ext/mixed/js/core.js
@@ -203,6 +203,16 @@ function promiseTimeout(delay, resolveValue) {
return promise;
}
+function deferPromise() {
+ let resolve;
+ let reject;
+ const promise = new Promise((resolve2, reject2) => {
+ resolve = resolve2;
+ reject = reject2;
+ });
+ return {promise, resolve, reject};
+}
+
/*
* Common events