Mulig
Resolves multible promises with order: fastest, queue and stack.
Installation
npm install mulig --save
Usage
Summary
mulig
mulig()
mulig runs callback function as soon as promises resolve. You can return values from callback functions (success or error) and they will be passed with the prev param the next time callback is invoked.
simple example
const mulig = /** * resolves promises in order of completion * @param * @param * @param * @return */
complex example
const mulig = // Only for explaining purpose// takes value and resolves that value in a given timeconst getPromise = { } // Array of promisesconst promises =
queue
mulig.queue()
mulig.queue resolves all promises in order of given array. Even if a promise at index 2 (in array) resolves before promise at index 0 it wont call the success or error callback before promise at index 0 and 1 resolves.
simple example
const mulig = /** * resolves promises in order of given array * returns given promises * @param * @param * @param * @return */mulig
complex example
const mulig = // Only for explaining purpose// takes value and resolves that value of given timeconst getPromise = { } // Array of promisesconst promises = mulig
stack
mulig.stack()
same as mulig.queue() but resolve in order of reversed promise array
simple example
const mulig = mulig