DEV Community

Lavender
Lavender

Posted on

Using Promises in finally in ES6

promise
  .then((result) => { ··· })
  .catch((error) => { ··· })
  .finally(() => {
    /\*logic independent of success/error \*/
  })
Enter fullscreen mode Exit fullscreen mode

The handler is called when the promise is fulfilled or rejected

Useful links

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more