.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.

Start a load and watch finally clear the loading state.

Important JavaScript

setLoading(true);

loadReport()
  .then(function (report) {
    show(report);
  })
  .catch(function (error) {
    showError(error.message);
  })
  .finally(function () {
    setLoading(false); // always runs
  });