Add redux-logger.

This automatically logs state changes (in a readable form) to the js
console. We'll probably want to turn this off in production to cut down
on log noise.
This commit is contained in:
Dan Albert
2022-03-04 00:09:34 -08:00
parent a710ce5e1b
commit fef123c2d4
3 changed files with 51 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ import frontLinesReducer from "../api/frontLinesSlice";
import supplyRoutesReducer from "../api/supplyRoutesSlice";
import tgosReducer from "../api/tgosSlice";
import { Action, ThunkAction, configureStore } from "@reduxjs/toolkit";
import logger from "redux-logger";
export const store = configureStore({
reducer: {
@@ -13,6 +14,8 @@ export const store = configureStore({
supplyRoutes: supplyRoutesReducer,
tgos: tgosReducer,
},
// The logger middleware must be last or it won't log actions.
middleware: [logger],
});
export type AppDispatch = typeof store.dispatch;