/with-resolvers

Promise.witResolvers() polyfill.

Primary LanguageJavaScript

@ungap/with-resolvers

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());