Todo buttons work
This commit is contained in:
@@ -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: {},
|
||||
}),
|
||||
})
|
||||
]
|
||||
}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user