Skip to content

Commit

Permalink
Reuse native code instead
Browse files Browse the repository at this point in the history
  • Loading branch information
David Fahlander authored and dfahlander committed Oct 13, 2024
1 parent cf7e891 commit e67a6cd
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/helpers/promise.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,6 @@ 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
Expand Down Expand Up @@ -341,6 +331,8 @@ if (NativePromise) {
}));
});
});
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/withResolvers
if (NativePromise.withResolvers) DexiePromise.withResolvers = NativePromise.withResolvers;
}

/**
Expand Down

0 comments on commit e67a6cd

Please sign in to comment.