Last active
August 29, 2015 14:13
-
-
Save seanstrom/7bc06534240fcce71bcc to your computer and use it in GitHub Desktop.
Async JS/Node - Promises Always Async Output
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
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