1.0.7 • Published 2 years ago

promise.allsettled v1.0.7

Weekly downloads
2,475,716
License
MIT
Repository
github
Last release
2 years 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_samplegriffin-ui-librarytest-library-123test-haptik-libwifi_configuration_packagewsq-apispotify-lenstest-zeo-collectsupportedsvelte-component-libvision-camera-plugin-face-detectorvision-camera-base64-resizedvantiq-react@bungie/datastore@blkmarketco/components-library@praella/localisationistjitsi-meet-stepupjitsi-fmtechjrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libkhaled-salem-custom-componentsilib-loaderimtiny-cligsspinecheckhong1-utilsinstapacklib-mezon-meetmakebetter-clils-engineskonfig-release-itmercurius-caisymercurius-ibytemercurius-temp-dantemeganshop@wecraftapps/react-native-use-keyboard@webiz-public/lib-jitsi-meet@tuax-ssr/utils@ts4/micro@tlgeo/react-native-gdal@thinxviewx/core-rn@transcend-io/penumbra@vidyvault/react-native@vdtn359/mercurius@vlefr/lib-jitsi-meet@vitali_shcherbina/styled-lib@yunzhoukit/yunzhou-react-native@zcong/aggregator@zotasys/nativeactionalagent-get-agent@zocks-communications/client-sdk-react-nativeactionsflowawesome-module-kdarrow-admin-apiarchlibraryatelon-utilsappcharge-checkout@aysea/react-native-ui-library@azalpacir/react-native-dhp-printer@greguintow/mercurius48th-sns-sdk@aakatrov/jitsi-react-native-sdk@_nomtek/react-native-shimmer-animation@abnerh69/lib-jitsi-meet@axway/api-builder-plugin-invoke-flow@axway/api-builder-admin-api@axway/api-builder-plugin-ft-kafka@hai-platform/studio-pages@aibex/ayup@adatechnology/react-native-android-getnet-pos@adembacaj/react-native-google-pay@con-test/react-native-concent-common@ali5049/react-native-buttons
1.0.7

2 years ago

1.0.6

3 years ago

1.0.5

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago

0.0.1-security

7 years ago