Skip to content

Commit eed43cd

Browse files
authored
Fix some small things in the docs (#1386)
* docs: update code block language to typescript * docs: correct TanStack Starter to Start * docs: fix the default timeout of `awaitTxId` (it's 5s instead of 30s) see: https://github.com/fulopkovacs/db/blob/2c509a1da5c19901f3241239e29aaf20fbc477bd/packages/electric-db-collection/src/electric.ts#L643-L648
1 parent f60384b commit eed43cd

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

docs/collections/electric-collection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@ async function generateTxId(tx) {
187187
Electric is typically deployed behind a proxy server that handles shape configuration, authentication and authorization. This provides better security and allows you to control what data users can access without exposing Electric to the client.
188188

189189

190-
Here is an example proxy implementation using TanStack Starter:
190+
Here is an example proxy implementation using TanStack Start:
191191

192-
```js
192+
```typescript
193193
import { createServerFileRoute } from "@tanstack/react-start/server"
194194
import { ELECTRIC_PROTOCOL_QUERY_PARAMS } from "@electric-sql/client"
195195

@@ -311,7 +311,7 @@ Manually wait for a specific transaction ID to be synchronized:
311311
// Wait for specific txid
312312
await todosCollection.utils.awaitTxId(12345)
313313

314-
// With custom timeout (default is 30 seconds)
314+
// With custom timeout (default is 5 seconds)
315315
await todosCollection.utils.awaitTxId(12345, 10000)
316316
```
317317

packages/db/skills/db-core/collection-setup/references/electric-adapter.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ onInsert: async ({ transaction }) => {
7878

7979
## Utility Methods (`collection.utils`)
8080

81-
- `awaitTxId(txid, timeout?)` -- wait for txid in Electric stream; default timeout 30s
81+
- `awaitTxId(txid, timeout?)` -- wait for txid in Electric stream; default timeout 5s
8282
- `awaitMatch(matchFn, timeout?)` -- wait for message matching predicate; default timeout 3000ms
8383

8484
### Helper Exports

0 commit comments

Comments
 (0)