mirror of
https://github.com/ershisan99/it-incubator-todolist-ts-17-live-2024-08-17.git
synced 2026-02-04 05:12:07 +00:00
chore: refactor todolists reducer to use rtk
This commit is contained in:
@@ -1,8 +1,3 @@
|
||||
import {
|
||||
AddTodolistActionType,
|
||||
RemoveTodolistActionType,
|
||||
SetTodolistsActionType,
|
||||
} from './todolists-reducer'
|
||||
import {
|
||||
TaskPriorities,
|
||||
TaskStatuses,
|
||||
@@ -55,9 +50,9 @@ export const tasksReducer = (
|
||||
return copyState
|
||||
case 'SET-TODOLISTS': {
|
||||
const copyState = { ...state }
|
||||
action.todolists.forEach((tl) => {
|
||||
copyState[tl.id] = []
|
||||
})
|
||||
// action.todolists.forEach((tl) => {
|
||||
// copyState[tl.id] = []
|
||||
// })
|
||||
return copyState
|
||||
}
|
||||
case 'SET-TASKS':
|
||||
@@ -198,7 +193,5 @@ type ActionsType =
|
||||
| ReturnType<typeof removeTaskAC>
|
||||
| ReturnType<typeof addTaskAC>
|
||||
| ReturnType<typeof updateTaskAC>
|
||||
| AddTodolistActionType
|
||||
| RemoveTodolistActionType
|
||||
| SetTodolistsActionType
|
||||
| ReturnType<typeof setTasksAC>
|
||||
| any
|
||||
|
||||
Reference in New Issue
Block a user