const initialState = {
boards: {
byId: {
[ 45455 ]: {
id: 45455,
title: 'Дела',
listsIds: [ 34444 ]
}
},
allIds: [ 45455 ]
},
lists: {
byId: {
[ 34444 ]: {
id: 34444,
title: 'Тесты',
todosIds: [ 5555 ]
}
},
allIds: [ 34444 ]
},
todos: {
byId: {
[ 5555 ]: {
id: 5555,
title: 'Открыть',
active: true
}
},
allIds: [ 5555 ]
}
};
case DELETE_SOME_BY_ID:
const byId = { ...state.some.byId };
delete byId[action.payload.id];
const allIdis = state.some.allIdis.filter(el => el.id != action.payload.id);
return {
...state,
some: {
byId,
allIds,
},
};