From 505d364fe2247bc7e744afd1befed66a3ac81735 Mon Sep 17 00:00:00 2001 From: rain Date: Sat, 20 Jun 2026 08:15:28 -0400 Subject: [PATCH] docs: fix TypeScript reducer argument examples --- docs/docs/00200-core-concepts/00600-clients/00200-codegen.md | 4 ++-- .../00600-clients/00700-typescript-reference.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/docs/00200-core-concepts/00600-clients/00200-codegen.md b/docs/docs/00200-core-concepts/00600-clients/00200-codegen.md index f648e17a578..3575377a20a 100644 --- a/docs/docs/00200-core-concepts/00600-clients/00200-codegen.md +++ b/docs/docs/00200-core-concepts/00600-clients/00200-codegen.md @@ -189,10 +189,10 @@ For example, a `create_user` reducer becomes: ```typescript // Call the reducer -conn.reducers.createUser(name, email); +conn.reducers.createUser({ name, email }); // Register a callback to observe reducer invocations -conn.reducers.onCreateUser((ctx, name, email) => { +conn.reducers.onCreateUser((ctx, { name, email }) => { console.log(`User created: ${name}`); }); ``` diff --git a/docs/docs/00200-core-concepts/00600-clients/00700-typescript-reference.md b/docs/docs/00200-core-concepts/00600-clients/00700-typescript-reference.md index 759a0f85f10..66abdda2021 100644 --- a/docs/docs/00200-core-concepts/00600-clients/00700-typescript-reference.md +++ b/docs/docs/00200-core-concepts/00600-clients/00700-typescript-reference.md @@ -1088,7 +1088,7 @@ function MyComponent() { return (

Connected as: {identity?.toHexString()}

-
@@ -1136,7 +1136,7 @@ import { useReducer } from 'spacetimedb/react'; import { reducers } from './module_bindings'; const createPlayer = useReducer(reducers.createPlayer); -createPlayer('Alice'); +createPlayer({ name: 'Alice' }); ``` `useReducer` returns a function that calls the generated reducer. Calls made before the connection is ready are queued and flushed once the connection is established.