By initializing the Redux store with configureStore, we get redux-thunk by default. In development mode, the Redux devtools are automatically configured as well as default development middleware to ensure the state remains serializable and is not mutated outside of reducers.
Removing the API client from the store allows these middlewares to be added, because the API client was mutating itself outside of reducers and was non-serializable. The serializable checks should help in the future with maintaining a persistable store.
Remove unneeded dispatches, reducer, and helper function since the API client was removed.
configureStore
function from @reduxjs/toolkitconfigureStore
, we getredux-thunk
by default. In development mode, the Redux devtools are automatically configured as well as default development middleware to ensure the state remains serializable and is not mutated outside of reducers.Tested in web browser and an Android device.