2 ms·
I'm not a fan of mixing await and .then myself; let data = await (await fetch('/my/url')).json(); That's a one-liner, but you can split the request and js
by Cthulhu_ 8y ago
I'm not a fan of mixing await and .then myself;
let data = await (await fetch('/my/url')).json();
That's a one-liner, but you can split the request and json data as well (and you usually want to anyway because of error handling).