Skip to content

Commit 199a727

Browse files
committed
FIX typos
1 parent 486a182 commit 199a727

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

docs/collections/rxdb-collection.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The `@tanstack/rxdb-db-collection` package allows you to create collections that
2020
- Leverage RxDB's [replication plugins](https://rxdb.info/replication.html) to sync with CouchDB, MongoDB, Supabase, REST APIs, GraphQL, WebRTC (P2P) and more.
2121

2222

23-
## 1. Installation
23+
### 1. Installation
2424

2525
Install the RxDB collection packages along with your preferred framework integration.
2626

@@ -35,8 +35,8 @@ npm install @tanstack/rxdb-db-collection rxdb @tanstack/react-db
3535
import { createRxDatabase, addRxPlugin } from 'rxdb/plugins/core'
3636

3737
/**
38-
* Here we use the localstorage based storage for RxDB.
39-
* RxDB has a wide range of storages based on Dexie.js, IndexedDB, SQLite and more.
38+
* Here we use the localStorage based storage for RxDB.
39+
* RxDB has a wide range of storages based on Dexie.js, IndexedDB, SQLite, and more.
4040
*/
4141
import { getRxStorageLocalstorage } from 'rxdb/plugins/storage-localstorage'
4242

@@ -93,7 +93,7 @@ import { rxdbCollectionOptions } from '@tanstack/rxdb-db-collection'
9393

9494
const todosCollection = createCollection(
9595
rxdbCollectionOptions({
96-
rxCollection: myDatabase.todos,
96+
rxCollection: db.todos,
9797
startSync: true, // start ingesting RxDB data immediately
9898
})
9999
)
@@ -118,7 +118,7 @@ The `rxdbCollectionOptions` function accepts the following options:
118118
### Optional
119119

120120
- `id`: Unique identifier for the collection
121-
- `schema`: Schema for validating items. RxDB already has schema validation but having additional validation on the TanStack DB side can help to unify error handling between different tanstack collections.
121+
- `schema`: Schema for validating items. RxDB already has schema validation but having additional validation on the TanStack DB side can help to unify error handling between different TanStack collections.
122122
- `startSync`: Whether to start syncing immediately (default: true)
123123
- `onInsert, onUpdate, onDelete`: Override default persistence handlers. By default, TanStack DB writes are persisted to RxDB using bulkUpsert, patch, and bulkRemove.
124124
- `syncBatchSize`: The maximum number of documents fetched per batch during the initial sync from RxDB into TanStack DB (default: 1000). Larger values reduce round trips but use more memory; smaller values are lighter but may increase query calls. Note that this only affects the initial sync. Ongoing live updates are streamed one by one via RxDB's change feed.
@@ -138,7 +138,7 @@ This separation of concerns means you configure replication entirely in RxDB, an
138138

139139
### Do I still need RxDB schema indexes if I only query TanStack DB?
140140

141-
Usually not for TanStack DB queries themselves. TanStack DB queries run entirely in memory, so RxDB schema indexes do not affect the performance of TanStack DB's live queries. However, RxDB indexes may still be important if:
141+
Usually not, at least for TanStack DB queries themselves. TanStack DB queries run entirely in memory, so RxDB schema indexes do not affect the performance of TanStack DB's live queries. However, RxDB indexes may still be important if:
142142
- You run queries directly against RxDB (e.g. `rxCollection.find(...)`).
143143
- Your replication setup uses filtered queries or selectors.
144144
- You rely on RxDB to selectively load subsets of data instead of hydrating everything into memory.

0 commit comments

Comments
 (0)