diff --git a/docs/collections/local-only-collection.md b/docs/collections/local-only-collection.md index a555ba9e50..17bf51ef4b 100644 --- a/docs/collections/local-only-collection.md +++ b/docs/collections/local-only-collection.md @@ -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' @@ -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] @@ -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' @@ -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] diff --git a/docs/collections/local-storage-collection.md b/docs/collections/local-storage-collection.md index 3033c3bbd1..171e5cb9b4 100644 --- a/docs/collections/local-storage-collection.md +++ b/docs/collections/local-storage-collection.md @@ -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' @@ -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]