Skip to content
Merged
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
13 changes: 13 additions & 0 deletions docs/guides/sqlite-persistence.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,19 @@ With `initialRender: { strategy: 'network-first', networkTimeoutMs }`, the Colle
- the SQLite restore completed and installed at least one row, and
- the deadline passed, or the sync adapter failed its first load.

To render cached rows as soon as the restore completes, set `networkTimeoutMs: 0`. Use this when a fast first render is more important than fresh data:

```ts
persistedCollectionOptions({
...todoSyncOptions,
persistence: syncedPersistence,
schemaVersion: 1,
initialRender: { strategy: 'network-first', networkTimeoutMs: 0 },
})
```

A Collection with restored rows then becomes `ready` from them immediately. Network sync continues, and its changes apply over the restored rows when they arrive. An empty restore still waits for the network, so the Collection never shows an empty list that the network did not confirm. An on-demand Collection applies this to each query demand, as [On-demand Collections offline](#on-demand-collections-offline) describes.

The status is the only signal. Every hook, Suspense, and `preload()` follow it, so you do not need a separate persisted flag:

```tsx
Expand Down
Loading