mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
re-structure to monorepo.
This commit is contained in:
14
packages/webapp/src/store/ResetMiddleware.tsx
Normal file
14
packages/webapp/src/store/ResetMiddleware.tsx
Normal file
@@ -0,0 +1,14 @@
|
||||
// @ts-nocheck
|
||||
export default (next) => (reducer, initialState, enhancer) => {
|
||||
let resetType = 'RESET'
|
||||
let resetData = 'state'
|
||||
|
||||
const enhanceReducer = (state, action) => {
|
||||
if (action.type === resetType) {
|
||||
state = action[resetData]
|
||||
}
|
||||
return reducer(state, action)
|
||||
}
|
||||
|
||||
return next(enhanceReducer, initialState, enhancer)
|
||||
}
|
||||
Reference in New Issue
Block a user