Home / Function/ Async_in_derived() — svelte Function Reference

Async_in_derived() — svelte Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  90418d31_1904_289a_266c_ea66c912e371["Async_in_derived()"]
  1a84bc6b_09da_b7d8_9856_b43064d56bcc["index.svelte.js"]
  90418d31_1904_289a_266c_ea66c912e371 -->|defined in| 1a84bc6b_09da_b7d8_9856_b43064d56bcc
  style 90418d31_1904_289a_266c_ea66c912e371 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/tests/snapshot/samples/async-in-derived/_expected/client/index.svelte.js lines 5–52

export default function Async_in_derived($$anchor, $$props) {
	$.push($$props, true);

	var yes1, yes2, no1, no2;

	var $$promises = $.run([
		async () => yes1 = await $.async_derived(() => 1),
		async () => yes2 = await $.async_derived(async () => foo(await 1)),
		() => no1 = $.derived(async () => {
			return await 1;
		}),

		() => no2 = $.derived(() => async () => {
			return await 1;
		})
	]);

	var fragment = $.comment();
	var node = $.first_child(fragment);

	{
		var consequent = ($$anchor) => {
			let yes1;
			let yes2;
			let no1;
			let no2;

			var promises = $.run([
				async () => yes1 = (await $.save($.async_derived(async () => (await $.save(1))())))(),
				async () => yes2 = (await $.save($.async_derived(async () => foo((await $.save(1))()))))(),
				() => no1 = $.derived(() => (async () => {
					return await 1;
				})()),

				() => no2 = $.derived(() => (async () => {
					return await 1;
				})())
			]);
		};

		$.if(node, ($$render) => {
			if (true) $$render(consequent);
		});
	}

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

Domain

Subdomains

Frequently Asked Questions

What does Async_in_derived() do?
Async_in_derived() is a function in the svelte codebase, defined in packages/svelte/tests/snapshot/samples/async-in-derived/_expected/client/index.svelte.js.
Where is Async_in_derived() defined?
Async_in_derived() is defined in packages/svelte/tests/snapshot/samples/async-in-derived/_expected/client/index.svelte.js at line 5.

Analyze Your Own Codebase

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

Try Supermodel Free