Skip to content

Instantly share code, notes, and snippets.

@othree
Created February 5, 2017 13:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save othree/6ded37ff00fc01aebecbb98628fb3a60 to your computer and use it in GitHub Desktop.
Save othree/6ded37ff00fc01aebecbb98628fb3a60 to your computer and use it in GitHub Desktop.
const all = Promise.all.bind(Promise);
const grabData = async files => await all(
(
await all(
files.map(f => fetch(f))
)
).map(v => v.json())
);
grabData(['/data1.json', '/data2.json']);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment