Skip to content

Commit

Permalink
fixup! Add Future implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
tshemsedinov committed Nov 30, 2024
1 parent 1726eb3 commit 348b298
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/future.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ class Future {
}

toPromise() {
return new Promise((resolve, reject) => {
this.fork(resolve, reject);
});
const { promise, resolve, reject } = Promise.withResolvers();
this.fork(resolve, reject);
return promise;
}

toThenable() {
Expand Down

0 comments on commit 348b298

Please sign in to comment.