Skip to content

Instantly share code, notes, and snippets.

@saintedlama
Created February 22, 2017 08:47
Show Gist options
  • Save saintedlama/eb58fa24d477492949226551cf6b62bf to your computer and use it in GitHub Desktop.
Save saintedlama/eb58fa24d477492949226551cf6b62bf to your computer and use it in GitHub Desktop.
Promise catch/then
new Promise((resolve, reject) => reject('does not work'))
.catch(e => { console.log('caught first', e); return 1; })
.then(val => console.log('first then', val))
.then(val => console.log('second then', val))
.catch(e => console.log('caught end', e));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment