alls (All Settled) - wait till all the promises settled
Just another library with the sole purpose of waiting till all promises to complete. Nothing more, Nothing less.
Promise.all()
method returns a single Promise that resolves when all of the promises passed as an iterable have resolved or when the iterable contains no promises. It rejects with the reason of the first promise that rejects.)
(Since, The https://rpgeeganage.github.io/alls/doc/
TypeScript Doc:Basic Usage:
const alls = ; const results = await ;// structure of results status: 'fulfilled' value: promise1-value status: 'rejected' reason: error-from-promise2 ... status: 'fulfilled' value: promiseN-value
Resolve
Return value for status: 'fulfilled' value: <promise return value>
Reject
Return value for status: 'rejected' reason: <Error thrown by promise>
final output
const error1 = 'error 1';const error2 = 'error 2';const error3 = 'error 3'; const results = await ; /*** content of the 'result'*/ state: 'fulfilled' value: 1 state: 'rejected' reason: error1 state: 'fulfilled' value: 2 state: 'rejected' reason: error2 state: 'fulfilled' value: 3 state: 'rejected' reason: error3