Skip to content

Instantly share code, notes, and snippets.

@zeevallin
Created June 6, 2016 23:15
Show Gist options
  • Save zeevallin/36d648694432139e645589604541b321 to your computer and use it in GitHub Desktop.
Save zeevallin/36d648694432139e645589604541b321 to your computer and use it in GitHub Desktop.
export function reflect(promises) {
function handler(promise) {
return promise.then(
(result)=>{ return { status: "resolved", result: result } },
(result)=>{ return { status: "rejected", result: result } }
)
}
return Promise.all(promises.map(handler))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment