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