getndazn / kopytko-utils

A collection of modern utility functions for Brightscript applications
MIT License
6 stars 4 forks source link

feat: added promisesAllSettled method that resolves after all of the given promises have either fulfilled or rejected #12

Closed kuldeepk-dazn closed 2 years ago

kuldeepk-dazn commented 2 years ago

What did you implement:

Closes #ROKU-142

Added promisesAllSettled function that takes an array of promises as an input and returns a promise that resolves after all of the given promises have either fulfilled or rejected with an array of objects that each describes the outcome of each promise.

How did you implement it:

Function loops through the given promises and wait until all promises have been resolved or rejected. Once all promises are settled it returns the promise with an array of objects [status, value] for all the promises.

How can we verify it:

/src/components/promise/_tests/promisesAllSettled.test.brs

Todos:

Is this ready for review?: YES Is it a breaking change?: NO

github-actions[bot] commented 2 years ago

:tada: This PR is included in version 2.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: