2021-10-07 15:43:20 +00:00
|
|
|
|
import superjson from "superjson";
|
|
|
|
|
|
2022-11-10 23:40:01 +00:00
|
|
|
|
import { createTRPCReact } from "@trpc/react-query";
|
2022-09-29 16:58:29 +00:00
|
|
|
|
|
2022-07-22 17:27:06 +00:00
|
|
|
|
// ℹ️ Type-only import:
|
|
|
|
|
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html#type-only-imports-and-export
|
2022-11-10 23:40:01 +00:00
|
|
|
|
import type { inferRouterInputs, inferRouterOutputs } from "../server";
|
2022-07-22 17:27:06 +00:00
|
|
|
|
import type { AppRouter } from "../server/routers/_app";
|
2021-09-27 14:47:55 +00:00
|
|
|
|
|
|
|
|
|
/**
|
2022-11-10 23:40:01 +00:00
|
|
|
|
* A set of strongly-typed React hooks from your `AppRouter` type signature with `createTRPCReact`.
|
|
|
|
|
* @link https://trpc.io/docs/v10/react#2-create-trpc-hooks
|
2021-09-27 14:47:55 +00:00
|
|
|
|
*/
|
2022-11-10 23:40:01 +00:00
|
|
|
|
export const trpc = createTRPCReact<AppRouter>();
|
2022-09-29 16:58:29 +00:00
|
|
|
|
|
2021-10-07 15:43:20 +00:00
|
|
|
|
export const transformer = superjson;
|
2021-09-27 16:09:19 +00:00
|
|
|
|
|
2022-11-10 23:40:01 +00:00
|
|
|
|
export type RouterInputs = inferRouterInputs<AppRouter>;
|
|
|
|
|
export type RouterOutputs = inferRouterOutputs<AppRouter>;
|