Created
June 6, 2016 23:01
-
-
Save zeevallin/68bf61353dcf67405e2cfe5119102191 to your computer and use it in GitHub Desktop.
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
export function reflect(promises){ | |
function handler(promise) { | |
function response(status, result) { | |
return { status: status, result: result } | |
} | |
return promise.then( | |
response.bind("resolved"), | |
response.bind("rejected") | |
) | |
} | |
return Promise.all(arr.map(handler)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment