How to choose the correct operator
The RxJS library has an extensive number of operators that can help simplify your code and handle corner cases of asynchrony and even performance.
You don’t need to memorize all the operators and the ones we’ve seen so far will help you with the most common cases.
The library documentation has a Decision Tree page, and we’ll learn how to navigate that.
Enter the site (https://rxjs.dev/operator-decision-tree) and, here, we will navigate to an operator that we have already studied to exemplify the use of this tool.
Figure 9.2 – Operator Decision Tree
Let’s go back to our form example. We need to fetch the exercise information from what the user’s typing – let’s assume that we don’t know which operator to choose.
We already have an observable, which is the valueChanges
event in the Angular form, so on the first screen, we will choose the I have one...