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

Function lazy

packages/server/src/lazy.ts:23–30  ·  view source on GitHub ↗
(loader: () => Promise<{ default: T }>, meta: LazyMeta = {})

Source from the content-addressed store, hash-verified

21 * @warning The `prefix` in `meta` only holds metadata and does not apply the prefix to the lazy router, use `os.prefix(...).lazy(...)` instead.
22 */
23export function lazy<T>(loader: () => Promise<{ default: T }>, meta: LazyMeta = {}): Lazy<T> {
24 return {
25 [LAZY_SYMBOL]: {
26 loader,
27 meta,
28 },
29 }
30}
31
32export function isLazy(item: unknown): item is Lazy<any> {
33 return (

Callers 15

ping_with_lazyMethod · 0.90
routerMethod · 0.90
implementerInternalFunction · 0.90
lazy.test.tsFile · 0.90
lazyMethod · 0.90
getRouterFunction · 0.90

Calls

no outgoing calls

Tested by 1

routerMethod · 0.72