Skip to content

Instantly share code, notes, and snippets.

@rbren
Created September 21, 2017 17:17
Show Gist options
  • Save rbren/ca7adb59864e27839c1afde760dc6b13 to your computer and use it in GitHub Desktop.
Save rbren/ca7adb59864e27839c1afde760dc6b13 to your computer and use it in GitHub Desktop.
Promise.resolve()
.then(_ => api.getItem(1))
.then(item => {
item.amount++;
return api.updateItem(1, item);
})
.catch(e => {
console.log('failed to get or update item');
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment