Typeahead Application Using Debounced Function

Let's finalize our application by adding a loading spinner with the help of the tap operator and see our app in action.

Loading spinner and tap operator

Let’s show off a bit and add a loading spinner.

We know something’s actually changed when a value hits the switchMap, so just before the switchMap, add a tap operator that will display the loading spinner.

Another tap just after the catch (or when the request has been completed) will hide the spinner.

These tap operations let us isolate side effects from the main business logic.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy