Skip to content

Instantly share code, notes, and snippets.

@tonkotsuboy
Last active February 9, 2018 05:25
Show Gist options
  • Save tonkotsuboy/d21d1c1acaa77b2dbf890545285eccaf to your computer and use it in GitHub Desktop.
Save tonkotsuboy/d21d1c1acaa77b2dbf890545285eccaf to your computer and use it in GitHub Desktop.
await/async
async function main() {
const response = await fetch(url1);
const arrayBuffer1 = await response.arrayBuffer();
const response2 = await fetch(arrayBuffer1.url);
const arrayBuffer2 = await response2.arrayBuffer();
console.log(arrayBuffer1, arrayBuffer2);
}
main();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment