Promise finally
Run cleanup whether the promise fulfills or rejects.
.finally(handler) always runs after settlement — success or failure.
Use it to clear a loading message, re-enable a button, or hide a spinner.
It does not receive the value or error; keep those in .then /
.catch.
Idle
Results appear here.
Important JavaScript
setLoading(true);
loadReport()
.then(function (report) {
show(report);
})
.catch(function (error) {
showError(error.message);
})
.finally(function () {
setLoading(false); // always runs
});