mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
deploy: leporello-js/app@a6e3f1b36f
This commit is contained in:
@@ -1,18 +1,16 @@
|
||||
const todos = (state = [], action) => {
|
||||
if(action.type == 'ADD_TODO') {
|
||||
if (action.type == "ADD_TODO") {
|
||||
return [
|
||||
...state,
|
||||
{
|
||||
id: action.id,
|
||||
text: action.text,
|
||||
completed: false
|
||||
}
|
||||
completed: false,
|
||||
},
|
||||
]
|
||||
} else if(action.type == 'TOGGLE_TODO') {
|
||||
} else if (action.type == "TOGGLE_TODO") {
|
||||
return state.map(todo =>
|
||||
(todo.id === action.id)
|
||||
? {...todo, completed: !todo.completed}
|
||||
: todo
|
||||
todo.id === action.id ? { ...todo, completed: !todo.completed } : todo,
|
||||
)
|
||||
} else {
|
||||
return state
|
||||
|
||||
Reference in New Issue
Block a user