DEV Community

Discussion on: "Synchronous" fetch with async/await

Collapse
 
uclaeamsavino profile image
uclaeamsavino • Edited

Yo dog I heard you like await, so I put an await inside your await:

const data = await (await fetch('https://api.com/values/1')).json();

It would be nice if fetch offered a one-step method to get straight to the JSON data.

How do you get the nice sublime font colors?

Collapse
 
johnpaulada profile image
John Paul Ada

LOL
You could create a function for that.
I just create a javascript code block in markdown for the colors. :)