MCPcopy Index your code
hub / github.com/SuboptimalEng/coding-tutorials / toggleToDo

Function toggleToDo

react-redux-todo/src/AppWithReactHooks.tsx:30–35  ·  view source on GitHub ↗
(toDoId: number)

Source from the content-addressed store, hash-verified

28 const [toDo, setToDo] = useState('');
29
30 const toggleToDo = (toDoId: number) => {
31 const i = toDos.findIndex((toDo) => toDo.id === toDoId);
32 const newToDos = [...toDos];
33 newToDos[i].completed = !newToDos[i].completed;
34 setToDos(newToDos);
35 };
36
37 const addToDo = () => {
38 setToDos([

Callers 1

AppWithReactHooksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected