MCPcopy Create free account
hub / github.com/middleapi/orpc / lazy

Method lazy

packages/server/src/builder.ts:329–333  ·  view source on GitHub ↗

* Create a lazy router * And applies all of the previously defined options to the specified router. * * @see https://orpc.dev/docs/router#extending-router Extending Router Docs

(
    loader: () => Promise<{ default: U }>,
  )

Source from the content-addressed store, hash-verified

327 * @see {@link https://orpc.dev/docs/router#extending-router Extending Router Docs}
328 */
329 lazy<U extends Router<ContractRouter<TMeta>, TCurrentContext>>(
330 loader: () => Promise<{ default: U }>,
331 ): EnhancedRouter<Lazy<U>, TInitialContext, TCurrentContext, TErrorMap> {
332 return enhanceRouter(lazy(loader), this['~orpc']) as any // Type instantiation is excessively deep and possibly infinite
333 }
334}
335
336export const os = new Builder<

Callers

nothing calls this directly

Calls 2

enhanceRouterFunction · 0.90
lazyFunction · 0.90

Tested by

no test coverage detected