Skip to content

Commit

Permalink
chore(frontend): configured redux-logger
Browse files Browse the repository at this point in the history
  • Loading branch information
Koufan-De-King committed Jul 24, 2024
1 parent afaa997 commit 6aff19c
Show file tree
Hide file tree
Showing 4 changed files with 654 additions and 724 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
"react": "^18.3.1",
"react-daisyui": "^5.0.0",
"react-dom": "^18.2.0",
"react-redux": "^9.1.2",
"react-i18next": "^14.1.1",
"react-redux": "^9.1.2",
"react-router-dom": "^6.23.0",
"redux": "^5.0.1",
"redux-logger": "^3.0.6",
"redux-toolkit": "^1.1.2",
"tailwindcss": "^3.4.3",
"theme-change": "^2.5.0"
Expand All @@ -42,6 +43,7 @@
"@types/i18next-browser-languagedetector": "^3.0.0",
"@types/react": "^18.2.66",
"@types/react-dom": "^18.2.22",
"@types/redux-logger": "^3.0.13",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"@vitejs/plugin-react": "^4.2.1",
Expand All @@ -50,7 +52,7 @@
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react": "^7.35.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"husky": "^9.0.11",
Expand Down
16 changes: 16 additions & 0 deletions src/store/configureStore.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { configureStore } from '@reduxjs/toolkit';
import { createLogger } from 'redux-logger';
import { rootReducer } from './reducers';

const logger = createLogger({
// Customize the logger options as needed
});

const store = configureStore({
reducer: rootReducer,
middleware: (getDefaultMiddleware) =>
getDefaultMiddleware().concat(logger),
});

export type AppDispatch = typeof store.dispatch;
export type AppState = ReturnType<typeof store.getState>;
3 changes: 3 additions & 0 deletions src/store/reducers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const rootReducer = {
// Add your reducers here
};
Loading

0 comments on commit 6aff19c

Please sign in to comment.