/
githubmirror
/
trpc
Обзор
Документация
Войти
/
githubmirror
/
trpc
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
examples/next-big-router/src/server/context.ts
25 строк
679 B
Alex / KATT
chore(www): bump docusaurus (#6051)
27 сен 2024, 17:12
Не верифицирован
27 сен 2024, 17:12
f8e8d17
Код
Авторство
О чём код?
import type * as trpcNext from '@trpc/server/adapters/next'; 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> { return await createContextInner({}); }