Created
September 21, 2017 17:17
-
-
Save rbren/ca7adb59864e27839c1afde760dc6b13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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