1.0.7 • Published 8 months ago

promise.allsettled v1.0.7

Weekly downloads
2,475,716
License
MIT
Repository
github
Last release
8 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_sampledemo-test-scrndesign-system-fitbank-450dbotsfawaterak-online-paymentfawatrak-online-paymenteyevinn-channel-enginefastify-gqlfastify-gql-forkfhir-works-on-aws-persistence-ddbfluent.adflow.reactnativesdkfluent.adflow.reactnativesdk-alphafn-lib-examplefmsldogandev-simple-toastdiscuz-uniappexpo-renavigateexpo-livekitimtiny-cli@hai-platform/studio-pages@greguintow/mercuriusilib-loaderinstapack@ceproject/utils@blusalt-sdk/react-native-blusalt-document-verificationegg-common-utilgriffin-ui-library@ew-did-registry/jwt@exio.tech/upload-multipart-image@evershop/core@evershop/evershopgsspinecheckgoogle-remake@einstonlabs/lib-jitsi-meet@fl-did-registry/jwt@extrieve_technologies/quickcapture_react_native@eyevinn/hls-recordergamification-integration-newframework_test_library_sixdeeframework_test_library_sixdee_newframework_test_library_sixdee_new_newgeoally-coregenz-native-elements@dtelecom/react-nativegaurav-react-native-loop@femessage/dockerize-clihong1-utilsjrennsoh88-react-native-scroll-indicatorjordy-frijters-test-lib@idas1/ui-component-libjitsi-meet-stepup@kahirokunn/vuedtskonfig-release-it@ivicos/lib-jitsi-meet@joinera/lib-jitsi-meet@jfilipe-sparta/react-native-module_2khaled-salem-custom-components@jitsi/react-native-sdk@kne/react-view-render@ketenburhan/lib-jitsi-meetjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwytest_lib_module_aar@blkmarketco/components-librarycng-node-js-utils@aws/fhir-works-on-aws-persistence-ddb@aysea/react-native-ui-library@azalpacir/react-native-dhp-printer@axway/api-builder-admin-api@axway/api-builder-plugin-ft-kafka@axway/api-builder-plugin-invoke-flow@cs6/react-native-test-native-view-library@brantalikp/rn-resize
1.0.7

8 months ago

1.0.6

1 year 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