From cf7e8914e05b477470e7e7118cc55b5b619f8d63 Mon Sep 17 00:00:00 2001 From: David Fahlander Date: Mon, 30 Sep 2024 16:41:54 +0200 Subject: [PATCH] Resolves #2078 --- src/helpers/promise.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/helpers/promise.js b/src/helpers/promise.js index f971a2888..5d668cb6d 100644 --- a/src/helpers/promise.js +++ b/src/helpers/promise.js @@ -261,6 +261,16 @@ props (DexiePromise, { }); }, + withResolvers () { + // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers + let resolve, reject; + const promise = new this((res, rej) => { + resolve = res; + reject = rej; + }); + return { promise, resolve, reject }; + }, + PSD: { get: ()=>PSD, set: value => PSD = value