promise-recurse
Recursive promise chains. Useful e.g. for paginated APIs that include a promise or URL for next page in each response.
Install
npm install --save promise-recurse
Use
promiseRecurse(startPromise: Promise, makeNextPromise: Function): Promise
startPromise
A promise to resolve first.makeNextPromise
A function that, given the resolved value of previous promise, returns next promise to resolve. Return a falsy value to end.
var promiseRecurse = promiseRecurse