redux-paginator
redux-paginator copied to clipboard
the TODOS_RECEIVED case will never execute since this lib only dispatch RECEIVE_PAGE
the TODOS_RECEIVED case will never execute since this lib only dispatch RECEIVE_PAGE , so I don't why we need to create add TODOS_RECEIVED case in the example?
const todos = (todos = {}, action = {}) {
switch (action.type) {
case 'TODOS_RECEIVED':
let _todos = {}
for (let todo of action.results) {
_todos = {
...todos,
[todo.id]: todo
}
}
return {
...todos,
..._todos
}
default:
return todosPaginator.itemsReducer(todos, action)
}
}
export default combineReducers({
todos,
pagination: todosPaginator.reducers
})