Async (async / await)
Asynchronous (async / await)
A way to keep everything else from freezing while you wait for something slow, like getting data from a server.
💡 It's a café buzzer. You order, wait at your seat, and when it buzzes (await), you pick up your coffee.
🤖 Say this to your AI
Clean up the data loading part with async/await. Show a loading state while waiting, an error message if it fails, and the result when it's done.
The key word is ‘Asynchronous (async / await)’. Including it helps AI understand you much more precisely.
📌 Good to know
If '[object Promise]' shows up on screen, the value was used without waiting (await) for it.
When to use it
- When the screen freezes or stays empty while data loads
- When 'Promise' or 'await' shows up in an error
- When things that should happen in order get mixed up
Also called: async, await, asynchronous, synchronous, promise, then, callback, object promise, waiting