Skip to content

Instantly share code, notes, and snippets.

@seanstrom
Last active August 29, 2015 14:13
Show Gist options
  • Save seanstrom/479956f3c2c7953d85a0 to your computer and use it in GitHub Desktop.
Save seanstrom/479956f3c2c7953d85a0 to your computer and use it in GitHub Desktop.
Async JS/Node - Using Promise Example
var endpoint = 'my/endpoint'
var dataPromise = getData(endpoint)
dataPromise.then(function(data) {
console.log(data)
}, function(error) {
console.error(error)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment