Skip to content

Instantly share code, notes, and snippets.

@othree
Created February 5, 2017 15:00
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/86a83c65e1315b0c04e2f89cf7743230 to your computer and use it in GitHub Desktop.
Save othree/86a83c65e1315b0c04e2f89cf7743230 to your computer and use it in GitHub Desktop.
const all = Promise.all.bind(Promise);
const fetchJSON = async file => (await fetch(file)).json();
const grabData = async files => await all(files.map(fetchJSON));
(async () => {
let [data1, data2] = await grabData(['/data1.json', '/data2.json']);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment