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@cs6/react-native-test-native-view-library@con-test/react-native-concent-common@cylonix/lib-jitsi-meet@damruravihara/react-native-testing-package@cuongdq/js-orm@coyote-labs/ember-fingerprint-assets@coyote-labs/html-lint@bungie/datastore@blkmarketco/components-library@praella/localisationistjitsi-meet-stepupjitsi-fmtechjrennsoh88-react-native-scroll-indicatorjesh-calculationjnf-accesscontrol-rnttljordy-frijters-test-libkhaled-salem-custom-componentsjawwy_library_newjawy_library_v1gamification-jawwy-libraryframework_test_library_sixdee_new_jawwytest_lib_module_aarquickcapture_react_nativern-agora-ios-mlib-jitsi-meet-oxtiotazreact-native-omental-frameworkreact-native-sixdee_test_libsquadus-lib-jitsi-meetsolid-tiddlywiki-syncadaptoru-librarytypescript-esm@amiruldev/wajs@amirdiafi/react-native-ios-haptics@aviinash_jha/react-native-test_multiply@ali5049/react-native-buttons@aws/fhir-works-on-aws-persistence-ddb@aysea/react-native-ui-library@axway/api-builder-admin-api@axway/api-builder-plugin-ft-kafka@axway/api-builder-plugin-invoke-flow@aibex/ayup@brantalikp/rn-resize@chenjm/nestjs-redis@ceproject/utils48th-sns-sdk@adatechnology/react-native-android-getnet-pos@adembacaj/react-native-google-pay@_nomtek/react-native-shimmer-animation@aakatrov/jitsi-react-native-sdk@abnerh69/lib-jitsi-meet@azalpacir/react-native-dhp-printeryangtao-jsyarn-react-hook-formvue-type-declarationvued-type-declarationwebpack-build-linked-packages@samedaycustom/hooks@samedaycustom/input@femessage/dockerize-cli@dtelecom/react-native@greguintow/mercurius@hai-platform/studio-pages
1.0.7

2 years ago

1.0.6

3 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.1-security

6 years ago