Skip to content

Files

Latest commit

 

History

History
27 lines (18 loc) · 547 Bytes

no-return-in-finally.md

File metadata and controls

27 lines (18 loc) · 547 Bytes

Pattern: Use of return in finally()

Issue: -

Description

Disallow return statements inside a callback passed to finally(), since nothing would consume what's returned.

Example of correct code:

myPromise.finally(function(val) {
  console.log('value:', val)
})

Example of incorrect code:

myPromise.finally(function(val) {
  return val
})

Further Reading