1.0.7 • Published 9 months ago

promise.allsettled v1.0.7

Weekly downloads
2,475,716
License
MIT
Repository
github
Last release
9 months ago

promise.allsettled Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

ES Proposal spec-compliant shim for Promise.allSettled. Invoke its "shim" method to shim Promise.allSettled if it is unavailable or noncompliant. Note: a global Promise must already exist: the es6-shim is recommended.

This package implements the es-shim API interface. It works in an ES3-supported environment that has Promise available globally, and complies with the proposed spec.

Most common usage:

var assert = require('assert');
var allSettled = require('promise.allsettled');

var resolved = Promise.resolve(42);
var rejected = Promise.reject(-1);

allSettled([resolved, rejected]).then(function (results) {
	assert.deepEqual(results, [
		{ status: 'fulfilled', value: 42 },
		{ status: 'rejected', reason: -1 }
	]);
});

allSettled.shim(); // will be a no-op if not needed

Promise.allSettled([resolved, rejected]).then(function (results) {
	assert.deepEqual(results, [
		{ status: 'fulfilled', value: 42 },
		{ status: 'rejected', reason: -1 }
	]);
});

Tests

Simply clone the repo, npm install, and run npm test

airbnb-js-shimscommit-cz-fixeasy-select-rnhidemyname-proxy-parserwebprojectmobi@articulate/okta-profile-monitorcorvus-sst-clijitsi-meet-rnreact-native-jitsi-meet-libreact-native-printer-brothersreact-native-shekhar-bridge-test@oiti/documentoscopy-react-nativequoc-test@infinitebrahmanuniverse/nolb-promise_@saaspe/componentsjitsi-meet-react-native-rocketluminos-ui-core@everything-registry/sub-chunk-2481jawwy-sdkjawwy_gamification_releaseally-sdkreact-native-sphereuisphereuijawwy_libraryreact-native-credit-card-pkgreact-native-jawwy_samplegoogle-remakegriffin-ui-librarykonfig-release-itkhaled-salem-custom-componentslib-jitsi-meet-oxtiotazlib-mezon-meetls-enginesmakebetter-cligsspinecheckhong1-utilsinstapackilib-loaderimtiny-clijordy-frijters-test-libjitsi-meet-stepupjrennsoh88-react-native-scroll-indicatormeganshopmercurius-caisymercurius-ibytemercurius-temp-dantenew-awesome-4321next-page-layoutninchat-jitsi-meet-rnsdknative-date-picker-modulenative-modal-damage-vehiclenode-js-ormnorinpm-dependency-graph@rerad/lib-jitsi-meet@react-native-ui-design/button@sargiss/hls-recorder@samedaycustom/hooks@samedaycustom/input@stepsec/release@valifysolutions/react-native-vidvliveness@pie-dao/utils@praella/localisationist@power-doctest/cli@podlubnaja/ui-kit@thinxviewx/core-rn@tryghost/metrics@transcend-io/penumbra@tuax-ssr/utils@ts4/micro@szydlovski/slack-bolt-fork@taingo97/react-native-awesome-module@taingo97/react-native-bluetooth-xprinter@taingo97/react-native-expo-key-rsa-kt@taingo97/react-native-expo-rsa@taingo97/react-native-generate-key-rsa@taingo97/react-native-key-rsa@taingo97/react-native-print-xprinter@taingo97/react-native-rsa@taingo97/react-native-rsa-expo@taingo97/react-native-sunmi-printer@taingo97/react-native-telpo-printer@renkiari/e8-react-native-sdk@redsuperadmin/redwireless@release-git/release-git@vdtn359/mercurius@solana/blockexplorer@solyd/lib-jitsi-meet@sidghimire/react-native-mapbox-navigation@slack/bolt@sephriot/react-native-persistable-uri@simtropolis/metrics@servicenow/cli@skeetboothppq/component-library@setl/api-sdk@shivarajapple/first-library@status-im/react-native-transparent-video@vlefr/lib-jitsi-meet@vitali_shcherbina/styled-libwifi_configuration_package
1.0.7

9 months ago

1.0.6

2 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

4 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.1-security

5 years ago