mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-29 13:54:45 -05:00
17 lines
564 B
TypeScript
17 lines
564 B
TypeScript
import { createReactQueryHooks, createTRPCClient } from "@trpc/react";
|
|
import superjson from "superjson";
|
|
// Type-only import:
|
|
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export
|
|
import type { AppRouter } from "../pages/api/trpc/[trpc]";
|
|
|
|
// create helper methods for queries, mutations, and subscriptionos
|
|
export const client = createTRPCClient<AppRouter>({
|
|
url: "/api/trpc",
|
|
transformer: superjson,
|
|
});
|
|
|
|
// create react query hooks for trpc
|
|
export const trpc = createReactQueryHooks({
|
|
client,
|
|
});
|