1234567891011121314 |
- /**
- returns a function which executes promises one after another
- @param promiseGenerators an array of functions which return a promise
- @return function which executes the promises
- */
- const enqueue = (promiseGenerators) => {
- return promiseGenerators.reduce((f, promiseGenerator) => {
- return () => {
- return f().then(promiseGenerator);
- };
- });
- };
- export default enqueue;
|