Skip to content

Commit

Permalink
docs: add comments about superjson
Browse files Browse the repository at this point in the history
  • Loading branch information
exKAZUu committed Sep 13, 2024
1 parent f1f4a4e commit 109dae0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/infrastructures/trpcBackend/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ import type { BackendRouter } from './routers';
export const backendTrpcReact = createTRPCReact<BackendRouter>();

export const backendTrpcReactClient = backendTrpcReact.createClient({
// Date型を扱えるようにするため、 superjson を導入する。
links: [httpBatchLink({ url: '/api/trpc', transformer: superjson })],
});
1 change: 1 addition & 0 deletions src/infrastructures/trpcBackend/trpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import superjson from 'superjson';
import type { Context } from './context';

const t = initTRPC.context<Context>().create({
// Date型を扱えるようにするため、 superjson を導入する。
transformer: superjson,
});

Expand Down

0 comments on commit 109dae0

Please sign in to comment.