All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.modules.esnext.promise.with-resolvers.js Maven / Gradle / Ivy

There is a newer version: 3.39.0
Show newest version
'use strict';
var $ = require('../internals/export');
var newPromiseCapabilityModule = require('../internals/new-promise-capability');

// `Promise.withResolvers` method
// https://github.com/tc39/proposal-promise-with-resolvers
$({ target: 'Promise', stat: true }, {
  withResolvers: function withResolvers() {
    var promiseCapability = newPromiseCapabilityModule.f(this);
    return {
      promise: promiseCapability.promise,
      resolve: promiseCapability.resolve,
      reject: promiseCapability.reject
    };
  }
});




© 2015 - 2024 Weber Informatics LLC | Privacy Policy