We removed the loading indicator from the list because it was pulling from local state, but now we can convert that to Redux. Redux thunk allows us to dispatch multiple actions from the same thunk, so we can dispatch new actions that will tell the reducer to turn a loading indicator on and off.
Summary of Content:
- Create and dispatch two new actions: todosLoading, and todosLoaded
- Change the todos reducer to change a loading boolean based on those actions
- Use the todos.loading flag to turn the loading spinner on and off
- Add a Refresh button to the TodoList component that calls the loadTodos method, and reloads the todo items