const initialState = {
cats: [],
dogs: [],
hozyiny: []
}
const reducer = (state = initialState, action) => {
switch(action.type) {
case LOAD_ALL_DATA: {
const { cats, dogs, hozyiny } = action.data;
return Object.assign({}, state, { cats, dogs, hozyiny })
}
default:
return state
}
}