Dragon of Asynchronicity
Now we will finally face the big dragon of asynchronicity. Let's dive right in, with the introduction of the project that we are going to build.
We'll cover the following
Before starting this, let’s answer some questions:
-
Why do I want to read this?
Dealing with async is one of the hardest problems on the frontend.
-
What will I learn?
How to use RxJS to keep all of your async logic together.
-
What will I be able to do that I couldn’t do before?
Centralize async logic and move state into the RxJS library.
-
Where are we going next, and how does this fit in?
In the next chapter, we’ll see how the techniques learned in this chapter can prevent irritating race conditions.
Managing asynchronous events
If you’re anything like me, at some point you’ve played a video game. And if you’ve played a video game, you’ve been frustrated at how long it takes things to load.
A long time ago, I waited patiently for a game to load on our 56k connection, not realizing that something had failed and the loading bar’s status would be stuck at 99% for all eternity. Many years later, I’m getting my revenge by griping about it in a programming course. Right, back on topic.
At this point in your RxJS journey, you may feel like that old Wendy’s commercial: “Sure, Pig Latin was fun, but where’s the beef?” This is the beef chapter you’ve been waiting for.
You’ll dive into asynchronous programming on top of RxJS and never look at an AJAX call the same way again. So much of frontend coding is tied up in handling multiple AJAX calls around the internet.
Get hands-on with 1400+ tech skills courses.