Skip to content

Instantly share code, notes, and snippets.

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