Created
March 8, 2015 17:15
-
-
Save yuchi/f84762a3743c117f2938 to your computer and use it in GitHub Desktop.
Multiple requests with promises
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 Promise = require('bluebird'); | |
function provider(param) { | |
// questa funzione ritorna una promessa | |
} | |
// Tutte o il primo errore | |
Promise.all([ 'some', 'different', 'urls' ].map(provider)); | |
// Un oggetto { value(), reason() } per ogni promessa | |
Promise.settle([ 'some', 'different', 'urls' ].map(provider)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment