Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  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. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement