mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
14 lines
347 B
TypeScript
14 lines
347 B
TypeScript
// @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)
|
|
} |