For those who like short answers:
[func1, func2].reduce((p, f) => p.then(f), Promise.resolve());
More Related Contents:
- How to return many Promises and wait for them all before doing other stuff
- Call async/await functions in parallel
- Why is my infinite loop blocking when it is in an async function? [duplicate]
- ES6 promise settled callback?
- When is the body of a Promise executed?
- ES6 Promise.all() error handle – Is .settle() needed? [duplicate]
- Fulfill (don’t resolve) promise with another promise
- Why can I not throw inside a Promise.catch handler?
- Filtering an array with a function that returns a promise
- Why is the response object from JavaScript fetch API a promise?
- Why couldn’t popular JavaScript runtimes handle synchronous-looking asynchronous script?
- Why does the Promise constructor require a function that calls ‘resolve’ when complete, but ‘then’ does not – it returns a value instead?
- What is the best general practice to timeout a function in promise [closed]
- What are asynchronous functions in JavaScript? What is “async” and “await” in JavaScript?
- When would someone need to create a deferred?
- ES6 promise execution order for returned values
- Promises, pass additional parameters to then chain
- How to extract data out of a Promise
- What happens if you don’t resolve or reject a promise?
- Are JavaScript forever-pending promises bad?
- Why does javascript ES6 Promises continue execution after a resolve?
- JavaScript asynchronous programming: promises vs generators
- using await on global scope without async keyword
- ES6 Promise replacement of async.eachLimit / async.mapLimit
- Why does JavaScript Promise then handler run after other code?
- When is the body of a Promise constructor callback executed?
- Promise.all is returning an array of undefined and resolves before being done
- Javascript – arrow functions this in event handler?
- Best way to call an asynchronous function within map?
- How to create new instance of an extended class of custom elements