Skip to content

Commit

Permalink
build: add redux devtools extension
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-buiquang authored Apr 12, 2023
1 parent 8dbba94 commit f7835af
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"react-router": "^6.9.0",
"react-router-dom": "^6.9.0",
"redux": "^4.2.1",
"redux-devtools-extension": "^2.13.9",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-state-sync": "^3.1.4"
Expand Down
15 changes: 9 additions & 6 deletions src/state/store.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { createStateSyncMiddleware, initStateWithPrevTab } from 'redux-state-sync'
import { createStore, applyMiddleware, combineReducers } from 'redux'
import { composeWithDevTools } from 'redux-devtools-extension'
import { persistReducer, persistStore } from 'redux-persist'
import thunkMiddleware from 'redux-thunk'
import logger from 'redux-logger'
Expand Down Expand Up @@ -55,12 +56,14 @@ const persistedReducer = persistReducer(persistConfig, rootReducer)

export const store = createStore(
persistedReducer,
applyMiddleware(
thunkMiddleware,
logger,
createStateSyncMiddleware({
predicate: (action) => action.type == 'autoLogout/open' || action.type == 'autoLogout/close'
})
composeWithDevTools(
applyMiddleware(
thunkMiddleware,
logger,
createStateSyncMiddleware({
predicate: (action) => action.type == 'autoLogout/open' || action.type == 'autoLogout/close'
})
)
)
)
initStateWithPrevTab(store)
Expand Down

0 comments on commit f7835af

Please sign in to comment.