Skip to content

Commit

Permalink
[docs] Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Truong Hoang Dung authored and Truong Hoang Dung committed May 11, 2024
1 parent 0abbc08 commit f6fcda1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ export function TodoApp(props: TodoAppProps) {
completed: false,
};
_state.todos.push(newTodo);
dispatch('UpdateNewTodoText', { text: '' });
}
},
onChange: (_, { emit }) => {
emit('UpdateNewTodoText', { text: '' });
},
},
{
messages: ['ToggleTodo'],
Expand Down
4 changes: 3 additions & 1 deletion src/TodoApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,11 @@ export function TodoApp(props: TodoAppProps) {
completed: false,
};
_state.todos.push(newTodo);
dispatch('UpdateNewTodoText', { text: '' });
}
},
onChange: (_, { emit }) => {
emit('UpdateNewTodoText', { text: '' });
},
},
{
messages: ['ToggleTodo'],
Expand Down

0 comments on commit f6fcda1

Please sign in to comment.