Created
June 2, 2015 22:15
-
-
Save sergiodxa/4e51ac5e93eb55526a00 to your computer and use it in GitHub Desktop.
Resolver múltiples promesas con un solo then
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
import xhr from 'promised-xhr'; | |
Promise.all([xhr.get('/api/resource'), xhr.get('/api/resource2')]) | |
.then(([data1, data2]) => { | |
console.log(data1); | |
console.log(data2); | |
}) | |
.catch(error => { | |
console.log(error); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment