Skip to content

Commit

Permalink
Merge pull request #121 from skyf0l/main
Browse files Browse the repository at this point in the history
Allow non-async `createContext`
  • Loading branch information
icflorescu committed Jun 15, 2024
2 parents 6616534 + 9d13fda commit 3e7ae1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions package/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ export function createTRPCHandle<Router extends AnyRouter, URL extends string>({
url?: ValidRoute<URL>;

/**
* An async function that returns the tRPC context.
* A function that returns the tRPC context.
* @see https://trpc.io/docs/context
*/
createContext?: (event: RequestEvent) => Promise<inferRouterContext<Router>>;
createContext?: (
event: RequestEvent
) => inferRouterContext<Router> | Promise<inferRouterContext<Router>>;

/**
* A function that returns the response meta.
Expand Down

0 comments on commit 3e7ae1b

Please sign in to comment.