{
oneListOfObjects:[],
twoListOfObjects:[],
threeListOfObjects:[],
}{
oneListOfObjects:[объект1,обьект2],
twoListOfObjects:[объект3,обьект4],
threeListOfObjects:[объект5,обьект6],
}import { VisibilityFilters } from './actions'
const initialState = {
visibilityFilter: VisibilityFilters.SHOW_ALL,
todos: []
}
function todoApp(state, action) {
if (typeof state === 'undefined') {
return initialState
}
// For now, don't handle any actions
// and just return the state given to us.
return state
}
const initialData = {
boards:[],
lists:[],
tasks:[]
}export default combineReducers({
preload,
boards :boards,
lists :lists,
tasks :tasks
}){
preload:{boards:[object,object,],lists:[object,object,]tasks:[object,object,]},
boards:[],
lists:[],
tasks:[]
}
store.dispatch(getAllProducts())
export default function lists(state = {}, action){
if (action.type === 'FETCH_ALL') {
return action.data
}
if (action.type === 'GET_LISTS') {
return action.data
}
if (action.type === 'INSERT_LIST') {
return [
...state,action.data
];
}
if (action.type === 'CHANGE_LIST') {
return state.filter(element => element.is_delete == false )
}
return state;
}
boards:[объекты-доски] ,
lists:[объекты-списки],
tasks:[объекты-таски]root:
boards:[],
lists:[],
tasks:[],
export const getInitialState = () => dispatch => {
fetch(myRequest)
.then(response => response.json())
.then(data => {
dispatch(changeBoars(data.boards));
dispatch(changeLists(data.lists));
dispatch(changeTasks(data.tasks));
})
}if (action.type === 'FETCH_ALL') {
return action.data.boards;
}
if (action.type === 'FETCH_ALL') {
return action.data.lists
}
if (action.type === 'FETCH_ALL') {
return action.data.tasks;
}
{
oneListOfObjects:[],
twoListOfObjects:[],
threeListOfObjects:[],
}const initialData = {
boards:[],
lists:[],
tasks:[]
}
const store = createStore(reducer, initialData, composeWithDevTools(applyMiddleware(thunk)));export default combineReducers({
boards :boards,
lists :lists,
tasks :tasks
})