Promises & then/catch
What is the purpose of the finally() method in a Promise chain?
promise
.then(value => console.log(value))
.catch(error => console.error(error))
.finally(() => cleanup());
promise
.then(value => console.log(value))
.catch(error => console.error(error))
.finally(() => cleanup());