Home / Function/ getContext() — astro Function Reference

getContext() — astro Function Reference

Architecture documentation for the getContext() function in context.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  47173e12_3a4e_a5b1_203b_0f6a6b51a2be["getContext()"]
  6c681793_21f0_90a5_f19f_4f75388ab5a2["context.ts"]
  47173e12_3a4e_a5b1_203b_0f6a6b51a2be -->|defined in| 6c681793_21f0_90a5_f19f_4f75388ab5a2
  style 47173e12_3a4e_a5b1_203b_0f6a6b51a2be fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/preact/src/context.ts lines 12–26

export function getContext(result: RendererContext['result']): Context {
	if (contexts.has(result)) {
		return contexts.get(result)!;
	}
	let ctx = {
		c: 0,
		get id() {
			return 'p' + this.c.toString();
		},
		signals: new Map(),
		propsToSignals: new Map(),
	};
	contexts.set(result, ctx);
	return ctx;
}

Domain

Subdomains

Frequently Asked Questions

What does getContext() do?
getContext() is a function in the astro codebase, defined in packages/integrations/preact/src/context.ts.
Where is getContext() defined?
getContext() is defined in packages/integrations/preact/src/context.ts at line 12.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free