Skip to content

Commit

Permalink
perf(app/store): disable devtools on prod and autoBatch
Browse files Browse the repository at this point in the history
  • Loading branch information
exuanbo committed Dec 8, 2023
1 parent 5299d2d commit 6f0ab42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/app/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@ export const store = configureStore({
const defaultMiddleware = getDefaultMiddleware()
return defaultMiddleware.prepend(stateObserver.middleware, actionObserver.middleware)
},
devTools: import.meta.env.DEV,
preloadedState: getPreloadedState(),
enhancers: (getDefaultEnhancers) => {
const defaultEnhancers = getDefaultEnhancers()
const defaultEnhancers = getDefaultEnhancers({ autoBatch: false })
return defaultEnhancers
.concat(stateObserver.enhancer, actionObserver.enhancer)
.concat(subscribeChange)
.concat(stateObserver.enhancer, actionObserver.enhancer)
},
})

0 comments on commit 6f0ab42

Please sign in to comment.