Search⌘ K

Implementing a Loading Indicator

Understand how to implement loading indicators in Redux by dispatching actions before and after API requests. Learn to maintain a counter of pending requests in the UI state to show or hide spinners effectively during server communication.

We'll cover the following...
Loading image

A common question when using Redux is how to show a spinner when server requests are in progress. The middleware approach provides an answer using additional dispatch() calls. Before a request starts or after it completes, we can dispatch a special action to be caught by reducers responsible for the UI state.

Here, we dispatch ...