1const initialState = {
2 random: { value: 0 },
3 counter: 0,
4}
5
6const combineReducers = reducers => {
7 return (state, action) => {
8 return Object.keys(reducers).reduce(
9 (acc, prop) => {
10 return ({
11 ...acc,
12 ...reducers[prop]({ [prop]: acc[prop] }, action),
13 })
14 },
15 state
16 )
17 }
18}
19
20export { initialState, combineReducers }