Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function demo() {
- return new Promise((resolve, reject) => {
- ...
- // The problem here!!
- //I just found in some rare case we failed to call resolve or reject
- })
- }
- demo()
- .then(res => {
- console.log('resolve')
- console.log(res)
- })
- .catch(rej => {
- console.log('reject')
- console.log(rej)
- })
- .finally(() => {
- console.log('why')
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement