Skip to content

Instantly share code, notes, and snippets.

@rbren
Last active September 25, 2017 17:58
Show Gist options
  • Select an option

  • Save rbren/3fe563ca3b0ccd5e050dac28d3cc2cf0 to your computer and use it in GitHub Desktop.

Select an option

Save rbren/3fe563ca3b0ccd5e050dac28d3cc2cf0 to your computer and use it in GitHub Desktop.
Promise.resolve()
.then(_ => {
return api.getItem(1)
})
.then(item => {
item.amount++
return api.updateItem(1, item);
})
.then(update => {
return api.deleteItem(1);
})
.catch(e => {
console.log('error while working on item 1');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment