Home / Function/ Await_block_scope() — svelte Function Reference

Await_block_scope() — svelte Function Reference

Architecture documentation for the Await_block_scope() function in index.svelte.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  374b981d_fd86_79d3_a3f3_789aa6b19a5b["Await_block_scope()"]
  6231da3d_a6b4_363e_7f3e_da4de1ec9d3d["index.svelte.js"]
  374b981d_fd86_79d3_a3f3_789aa6b19a5b -->|defined in| 6231da3d_a6b4_363e_7f3e_da4de1ec9d3d
  style 374b981d_fd86_79d3_a3f3_789aa6b19a5b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/tests/snapshot/samples/await-block-scope/_expected/client/index.svelte.js lines 6–35

export default function Await_block_scope($$anchor) {
	let counter = $.proxy({ count: 0 });
	const promise = $.derived(() => Promise.resolve(counter));

	function increment() {
		counter.count += 1;
	}

	var fragment = root();
	var button = $.first_child(fragment);

	button.__click = increment;

	var text = $.child(button);

	$.reset(button);

	var node = $.sibling(button, 2);

	$.await(node, () => $.get(promise), null, ($$anchor, counter) => {});

	var text_1 = $.sibling(node);

	$.template_effect(() => {
		$.set_text(text, `clicks: ${counter.count ?? ''}`);
		$.set_text(text_1, ` ${counter.count ?? ''}`);
	});

	$.append($$anchor, fragment);
}

Domain

Subdomains

Frequently Asked Questions

What does Await_block_scope() do?
Await_block_scope() is a function in the svelte codebase, defined in packages/svelte/tests/snapshot/samples/await-block-scope/_expected/client/index.svelte.js.
Where is Await_block_scope() defined?
Await_block_scope() is defined in packages/svelte/tests/snapshot/samples/await-block-scope/_expected/client/index.svelte.js at line 6.

Analyze Your Own Codebase

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

Try Supermodel Free