singleton() — ui Function Reference
Architecture documentation for the singleton() function in singleton.server.ts from the ui codebase.
Entity Profile
Dependency Diagram
graph TD 235f8d60_44ad_843b_5d4f_e92fd565026e["singleton()"] 8167d6e6_66e4_311f_1efe_6e8c96f8300b["singleton.server.ts"] 235f8d60_44ad_843b_5d4f_e92fd565026e -->|defined in| 8167d6e6_66e4_311f_1efe_6e8c96f8300b 6ea51905_72cd_426d_f388_97e6b2a2039b["prisma()"] 6ea51905_72cd_426d_f388_97e6b2a2039b -->|calls| 235f8d60_44ad_843b_5d4f_e92fd565026e style 235f8d60_44ad_843b_5d4f_e92fd565026e fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/singleton.server.ts lines 5–13
export const singleton = <Value>(
name: string,
valueFactory: () => Value,
): Value => {
const g = global as unknown as { __singletons: Record<string, unknown> };
g.__singletons ??= {};
g.__singletons[name] ??= valueFactory();
return g.__singletons[name] as Value;
};
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does singleton() do?
singleton() is a function in the ui codebase, defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/singleton.server.ts.
Where is singleton() defined?
singleton() is defined in packages/shadcn/test/fixtures/frameworks/remix-indie-stack/app/singleton.server.ts at line 5.
What calls singleton()?
singleton() is called by 1 function(s): prisma.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free