/
githubmirror
/
trpc
Обзор
Документация
Войти
/
githubmirror
/
trpc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/next-prisma-starter/src/server/context.ts
29 строк
870 B
Julius Marminge
chore(deps): modernize deps & tooling (#6164)
30 окт 2024, 21:40
Не верифицирован
30 окт 2024, 21:40
84e267e
Код
Авторство
О чём код?
/* eslint-disable @typescript-eslint/no-unused-vars */ import type * as trpcNext from '@trpc/server/adapters/next'; // eslint-disable-next-line @typescript-eslint/no-empty-object-type interface CreateContextOptions { // session: Session | null } /** * Inner function for `createContext` where we create the context. * This is useful for testing when we don't want to mock Next.js' request/response */ export async function createContextInner(_opts: CreateContextOptions) { return {}; } export type Context = Awaited<ReturnType<typeof createContextInner>>; /** * Creates context for an incoming request * @see https://trpc.io/docs/v11/context */ export async function createContext( opts: trpcNext.CreateNextContextOptions, ): Promise<Context> { // for API-response caching see https://trpc.io/docs/v11/caching return await createContextInner({}); }