mirror of
https://github.com/Funkoala14/knowledgebase_law.git
synced 2025-06-09 05:58:15 +08:00
26 lines
690 B
Plaintext
26 lines
690 B
Plaintext
// @flow
|
|
|
|
import { combineReducers } from 'redux'
|
|
import persistReducer from './persistReducer'
|
|
import autoMergeLevel2 from './stateReconciler/autoMergeLevel2'
|
|
|
|
import type { PersistConfig } from './types'
|
|
|
|
type Reducers = {
|
|
[key: string]: Function,
|
|
}
|
|
|
|
type Reducer = (state: Object, action: Object) => Object
|
|
|
|
// combineReducers + persistReducer with stateReconciler defaulted to autoMergeLevel2
|
|
export default function persistCombineReducers(
|
|
config: PersistConfig,
|
|
reducers: Reducers
|
|
): Reducer {
|
|
config.stateReconciler =
|
|
config.stateReconciler === undefined
|
|
? autoMergeLevel2
|
|
: config.stateReconciler
|
|
return persistReducer(config, combineReducers(reducers))
|
|
}
|