Skip to content

Instantly share code, notes, and snippets.

@gskachkov
Created October 31, 2017 20:45
Show Gist options
  • Save gskachkov/343834625aba89ab648c3a2249d5044f to your computer and use it in GitHub Desktop.
Save gskachkov/343834625aba89ab648c3a2249d5044f to your computer and use it in GitHub Desktop.
Promise.reject('reject')
.finally(() => console.log('finally#1'))
.catch(error => console.log('catch#1', error))
.catch(error => console.log('catch#2', error));
//finally#1
//catch#1 reject
Promise.resolve('resolve')
.then(result=> { console.log('then#1', result); return Promise.resolve('next-step'); })
.finally(() => console.log('finally#1'))
.then(result => console.log('then#2', result));
//then#1 resolve
//finally#1
//then#2 next-step
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment