Skip to content

Instantly share code, notes, and snippets.

@zeevallin
Created June 6, 2016 23:01
Show Gist options
  • Save zeevallin/68bf61353dcf67405e2cfe5119102191 to your computer and use it in GitHub Desktop.
Save zeevallin/68bf61353dcf67405e2cfe5119102191 to your computer and use it in GitHub Desktop.
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