Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mmkal committed Aug 21, 2024
2 parents 42b39d6 + 8fa6f59 commit c9df3fb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,20 @@ export {
initTRPC,
} from '@trpc/server'

/** "starter" trpc instance. Useful to get a new project started without needing to set up `@trpc/server` manually */
/**
* A "starter" trpc instance. Useful to get a new project started without needing to set up `@trpc/server` manually.
* Equivalent to `initTRPC.meta<TrpcCliMeta>().create()`.
* Note: if you need to specify a context, use {@linkcode createTrpc}.
*/
export const trpc = initTRPC.meta<TrpcCliMeta>().create()

/**
* Create a "starter" trpc instance, with context.
* Equivalent to `initTRPC.meta<TrpcCliMeta>().context<Context>()`.
* Note: if you don't need to specify a context, just use {@linkcode trpc}.
*/
export const createTrpc = <Context extends {}>() => initTRPC.meta<TrpcCliMeta>().context<Context>().create()

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export type AnyRouter = Router<any>
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down

0 comments on commit c9df3fb

Please sign in to comment.