mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
adding step 7
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { Store } from '../store';
|
||||
import { addTodo, remove, complete } from './pureFunctions';
|
||||
import { clear } from '../../../step2-07/src/reducers/pureFunctions';
|
||||
|
||||
let index = 0;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ export function remove(state: Store, id: string) {
|
||||
}
|
||||
|
||||
export function complete(state: Store, id: string) {
|
||||
const newTodos = { ...this.state.todos };
|
||||
const newTodos = { ...state.todos };
|
||||
newTodos[id].completed = !newTodos[id].completed;
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user