Skip to content

Commit

Permalink
Update deps for TodoMVC React example
Browse files Browse the repository at this point in the history
  • Loading branch information
davidkpiano committed Jan 23, 2024
1 parent 04d22fe commit 43fc63b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion examples/todomvc-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"react-dom": "^17.0.2",
"todomvc-app-css": "^2.4.3",
"todomvc-common": "^1.0.5",
"xstate": "^5.4.1"
"xstate": "^5.5.1"
},
"devDependencies": {
"@types/react": "^17.0.73",
Expand Down
14 changes: 7 additions & 7 deletions examples/todomvc-react/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions examples/todomvc-react/src/todosMachine.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { assign, createMachine } from 'xstate';
import { assign, setup } from 'xstate';

export interface TodoItem {
id: string;
Expand All @@ -8,8 +8,7 @@ export interface TodoItem {

export type TodosFilter = 'all' | 'active' | 'completed';

export const todosMachine = createMachine({
id: 'todos',
export const todosMachine = setup({
types: {} as {
context: {
todo: string;
Expand All @@ -25,7 +24,9 @@ export const todosMachine = createMachine({
| { type: 'todo.mark'; id: string; mark: 'active' | 'completed' }
| { type: 'todo.markAll'; mark: 'active' | 'completed' }
| { type: 'todos.clearCompleted' };
},
}
}).createMachine({
id: 'todos',
context: {
todo: '',
todos: [
Expand Down

0 comments on commit 43fc63b

Please sign in to comment.