promise-every
Currently javascript does not have a Promise.every()
function, so here it is.
1. You have an iterable of Promises
.
2. You want to do something when they are all done.
3. You want all the data.
Code
Promiseevery = ;Promise;
Thats it!
If you want to access just the resolved or rejected promises the callback is passed three parameteres finished, resolved, rejected
.
In that order, finished
will contain both resolved and rejected promises in the order you provided them in.
Instalation
npm install every-promise
You can also just copypaste this into your code:
Promise { var len; const preserved = len = promiseslength; const resolved = rejected = ; { promisesfound }0};
Or useing the traditional .then().catch()
.
Promise { var len; const preserved = len = promiseslength; const resolved = rejected = ; { promisesfound }0};
Dependencies
None.