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)