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
  30115427_4a9e_40ec_568f_007b86ae9a89["Async_in_derived()"]
  8e86ce01_a83d_ae69_9215_549a0086ed05["index.svelte.js"]
  30115427_4a9e_40ec_568f_007b86ae9a89 -->|defined in| 8e86ce01_a83d_ae69_9215_549a0086ed05
  style 30115427_4a9e_40ec_568f_007b86ae9a89 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/tests/snapshot/samples/async-in-derived/_expected/server/index.svelte.js lines 4–55

export default function Async_in_derived($$renderer, $$props) {
	$$renderer.component(($$renderer) => {
		var yes1, yes2, no1, no2;

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

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

		if (true) {
			$$renderer.push('<!--[-->');

			let yes1;
			let yes2;
			let no1;
			let no2;

			var promises = $$renderer.run([
				async () => {
					yes1 = (await $.save(1))();
				},

				async () => {
					yes2 = foo((await $.save(1))());
				},

				() => {
					no1 = (async () => {
						return await 1;
					})();
				},

				() => {
					no2 = (async () => {
						return await 1;
					})();
				}
			]);
		} else {
			$$renderer.push('<!--[!-->');
		}

		$$renderer.push(`<!--]-->`);
	});
}

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/server/index.svelte.js.
Where is Async_in_derived() defined?
Async_in_derived() is defined in packages/svelte/tests/snapshot/samples/async-in-derived/_expected/server/index.svelte.js at line 4.

Analyze Your Own Codebase

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

Try Supermodel Free