diff --git a/docs/guides/sqlite-persistence.md b/docs/guides/sqlite-persistence.md index feea3f9954..68098b3c2d 100644 --- a/docs/guides/sqlite-persistence.md +++ b/docs/guides/sqlite-persistence.md @@ -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