SHARE
TWEET

Untitled

a guest Jun 25th, 2019 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function demo() {
  2.     return new Promise((resolve, reject) => {
  3.         ...
  4.         // The problem here!!
  5.         //I just found in some rare case we failed to call resolve or reject
  6.     })
  7. }
  8.  
  9. demo()
  10.     .then(res => {
  11.         console.log('resolve')
  12.         console.log(res)
  13.     })
  14.     .catch(rej => {
  15.         console.log('reject')
  16.         console.log(rej)
  17.     })
  18.     .finally(() => {
  19.         console.log('why')
  20.     })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top