Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/collections/local-only-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ await tx.commit()
## Complete Example: Modal State Management

```typescript
import { createCollection } from '@tanstack/react-db'
import { createCollection, eq } from '@tanstack/react-db'
import { localOnlyCollectionOptions } from '@tanstack/react-db'
import { useLiveQuery } from '@tanstack/react-db'
import { z } from 'zod'
Expand Down Expand Up @@ -194,7 +194,7 @@ export const modalStateCollection = createCollection(
function UserProfileModal() {
const { data: modals } = useLiveQuery((q) =>
q.from({ modal: modalStateCollection })
.where(({ modal }) => modal.id === 'user-profile')
.where(({ modal }) => eq(modal.id, 'user-profile'))
)

const modalState = modals[0]
Expand Down Expand Up @@ -228,7 +228,7 @@ function UserProfileModal() {
## Complete Example: Form Draft State

```typescript
import { createCollection } from '@tanstack/react-db'
import { createCollection, eq } from '@tanstack/react-db'
import { localOnlyCollectionOptions } from '@tanstack/react-db'
import { useLiveQuery } from '@tanstack/react-db'

Expand All @@ -250,7 +250,7 @@ export const formDraftsCollection = createCollection(
function CreatePostForm() {
const { data: drafts } = useLiveQuery((q) =>
q.from({ draft: formDraftsCollection })
.where(({ draft }) => draft.id === 'new-post')
.where(({ draft }) => eq(draft.id, 'new-post'))
)

const currentDraft = drafts[0]
Expand Down
4 changes: 2 additions & 2 deletions docs/collections/local-storage-collection.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ await tx.commit()
## Complete Example

```typescript
import { createCollection } from '@tanstack/react-db'
import { createCollection, eq } from '@tanstack/react-db'
import { localStorageCollectionOptions } from '@tanstack/react-db'
import { useLiveQuery } from '@tanstack/react-db'
import { z } from 'zod'
Expand Down Expand Up @@ -265,7 +265,7 @@ export const userPreferencesCollection = createCollection(
function SettingsPanel() {
const { data: prefs } = useLiveQuery((q) =>
q.from({ pref: userPreferencesCollection })
.where(({ pref }) => pref.id === 'current-user')
.where(({ pref }) => eq(pref.id, 'current-user'))
)

const currentPrefs = prefs[0]
Expand Down
Loading