diff --git a/usage/sync-streams.mdx b/usage/sync-streams.mdx index af182c59..705a75a9 100644 --- a/usage/sync-streams.mdx +++ b/usage/sync-streams.mdx @@ -103,8 +103,10 @@ Sync Streams will be supported alongside Sync Rules for the foreseeable future, * Sync Stream definitions. They are currently defined in the same YAML file as Sync Rules: `sync_rules.yaml` (PowerSync Cloud) or `config.yaml` (Open Edition/self-hosted). To enable Sync Streams, add the following configuration: ```yaml sync_rules.yaml - # see https://docs.powersync.com/usage/sync-rules/compatibility#overview config: + # see https://docs.powersync.com/usage/sync-rules/compatibility + # this edition also deploys several backwards-incompatible fixes + # see the docs for details edition: 2 streams: @@ -326,8 +328,10 @@ Select your language for specific examples: stream?.subscription.hasSynced; ``` + This hook is useful when you want to explicitly ensure a stream is active (for example a root component) or when you need progress/hasSynced state; this makes data available for all child components without each query declaring the stream. + Additionally, the `useQuery` hook for React can wait for Sync Streams to be complete before running - queries: + queries. Pass `streams` only when the component knows which specific stream subscription(s) it depends on and it should wait before querying. ```js const results = useQuery(