Here you can find some useful resources if you want to learn to write
async code I mean to gain a basic understanding of the event loop, and how to use and write promises with the promise syntax or with
await. You can also find some notes I wrote while reading, but I don’t know how useful they can be to you.
Learning to write asynchronous code takes time and effort. If you find yourself stuck at some point, and you feel you’re not making progress, first take a break. Then, find another resource that explains the topic you don’t understand, or revisit something you read previously—you’ll discover something you’ve missed on the first read.
I’m not sure who is this post for, but I can tell you how I felt before I started reading. I’ve used promises and
await in my code before, but when things were complicated:
- I wasn’t 100% sure if I was using them correctly.
- I was observing some behavior that I couldn’t explain.
If that sounds familiar, you’ll find the resources recommended here valuable.
There are the posts with the notes:
I broke it in 3 parts because each topic deserves a separate page, and because I plan to add more resources in the future. As a result, one page won’t be enough. I may also add new pages for other asynchronous topics like generators or even callbacks. For now, these topics are under the “Further reading” section.
Other things to read
- Reveal animations on scroll with react-spring
- Gatsby background image example
- Extremely fast loading with Gatsby and self-hosted fonts