@@ -10,7 +10,7 @@ TanStack DB is a reactive client store for building super fast apps. This exampl
10
10
- ** Mutate data** with instant optimistic updates
11
11
12
12
``` tsx
13
- import { createCollection , useLiveQuery } from ' @tanstack/react-db'
13
+ import { createCollection , eq , useLiveQuery } from ' @tanstack/react-db'
14
14
import { queryCollectionOptions } from ' @tanstack/query-db-collection'
15
15
16
16
// Define a collection that loads data using TanStack Query
@@ -36,7 +36,7 @@ function Todos() {
36
36
// Live query that updates automatically when data changes
37
37
const { data : todos } = useLiveQuery ((q ) =>
38
38
q .from ({ todo: todoCollection })
39
- .where (({ todo }) => ! todo .completed )
39
+ .where (({ todo }) => eq ( todo .completed , false ) )
40
40
.orderBy (({ todo }) => todo .createdAt , ' desc' )
41
41
)
42
42
@@ -112,7 +112,7 @@ function TodoList() {
112
112
// Basic filtering and sorting
113
113
const { data : incompleteTodos } = useLiveQuery ((q ) =>
114
114
q .from ({ todo: todoCollection })
115
- .where (({ todo }) => ! todo .completed )
115
+ .where (({ todo }) => eq ( todo .completed , false ) )
116
116
.orderBy (({ todo }) => todo .createdAt , ' desc' )
117
117
)
118
118
0 commit comments