Todo buttons work

This commit is contained in:
Julien Valverdé
2024-07-13 04:44:52 +02:00
parent e5641924f8
commit 329b9e7c41
2 changed files with 26 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { createWSClient, wsLink } from "@trpc/client"
import { createWSClient, httpBatchLink, splitLink, wsLink } from "@trpc/client"
import { ReactNode, useState } from "react"
import { trpc } from "./trpc"
@@ -16,12 +16,16 @@ export function TRPCClientProvider({ children }: TRPCClientProviderProps) {
const [trpcClient] = useState(trpc.createClient({
links: [
// httpBatchLink({
// url: "http://localhost:8080/rpc",
// headers: async () => ({}),
// }),
splitLink({
condition: op => op.type === "subscription",
wsLink({ client: wsClient }),
true: wsLink({ client: wsClient }),
false: httpBatchLink({
url: "http://localhost:8080/rpc",
headers: {},
}),
})
]
}))