Home / Type/ EachBlock Type — svelte Architecture

EachBlock Type — svelte Architecture

Architecture documentation for the EachBlock type/interface in template.d.ts from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  08614eff_cc28_308f_6480_a02ad38ae81c["EachBlock"]
  628b0d7d_f8bd_9570_9133_f9b9af4f58aa["template.d.ts"]
  08614eff_cc28_308f_6480_a02ad38ae81c -->|defined in| 628b0d7d_f8bd_9570_9133_f9b9af4f58aa
  style 08614eff_cc28_308f_6480_a02ad38ae81c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/compiler/types/template.d.ts lines 447–475

	export interface EachBlock extends BaseNode {
		type: 'EachBlock';
		expression: Expression;
		/** The `entry` in `{#each item as entry}`. `null` if `as` part is omitted */
		context: Pattern | null;
		body: Fragment;
		fallback?: Fragment;
		index?: string;
		key?: Expression;
		/** @internal */
		metadata: {
			expression: ExpressionMetadata;
			keyed: boolean;
			contains_group_binding: boolean;
			index: Identifier;
			declarations: Map<string, Binding>;
			/**
			 * Optimization path for each blocks: If the parent isn't a fragment and
			 * it only has a single child, then we can classify the block as being "controlled".
			 * This saves us from creating an extra comment and insertion being faster.
			 */
			is_controlled: boolean;
			/**
			 * Bindings this each block transitively depends on. In legacy mode, we
			 * invalidate these bindings when mutations happen to each block items
			 */
			transitive_deps: Set<Binding>;
		};
	}

Frequently Asked Questions

What is the EachBlock type?
EachBlock is a type/interface in the svelte codebase, defined in packages/svelte/src/compiler/types/template.d.ts.
Where is EachBlock defined?
EachBlock is defined in packages/svelte/src/compiler/types/template.d.ts at line 447.

Analyze Your Own Codebase

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

Try Supermodel Free