A Promise.withResolvers() polyfill.
import '@ungap/with-resolvers';
// require('@ungap/with-resolvers');
const {resolve, reject, promise} = Promise.withResolvers();
promise.then(console.log, console.error);
resolve(Math.random());| Name | Name | Last commit date | ||
|---|---|---|---|---|
A Promise.withResolvers() polyfill.
import '@ungap/with-resolvers';
// require('@ungap/with-resolvers');
const {resolve, reject, promise} = Promise.withResolvers();
promise.then(console.log, console.error);
resolve(Math.random());