Skip to content

Commit

Permalink
write-patterns: update shape definitions to use new params key.
Browse files Browse the repository at this point in the history
  • Loading branch information
thruflo committed Dec 4, 2024
1 parent dbb9755 commit 8cad7e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion examples/write-patterns/patterns/1-online-writes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ export default function OnlineWrites() {
// into a React state variable.
const { isLoading, data } = useShape<Todo>({
url: `${ELECTRIC_URL}/v1/shape`,
table: 'todos',
params: {
table: 'todos',
},
parser: {
timestamptz: (value: string) => new Date(value),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export default function OptimisticState() {
// local writes syncing back from the server.
const { isLoading, data, stream } = useShape<Todo>({
url: `${ELECTRIC_URL}/v1/shape`,
table: 'todos',
params: {
table: 'todos',
},
parser: {
timestamptz: (value: string) => new Date(value),
},
Expand Down
4 changes: 3 additions & 1 deletion packages/typescript-client/test/match.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ describe(`matchStream`, () => {
// @ts-nocheck
const stream = new ShapeStream({
url: `${BASE_URL}/v1/shape`,
table: issuesTableUrl,
params: {
table: issuesTableUrl,
},
})

const id = uuidv4()
Expand Down

0 comments on commit 8cad7e2

Please sign in to comment.