Home / Function/ renderIterable() — astro Function Reference

renderIterable() — astro Function Reference

Architecture documentation for the renderIterable() function in any.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  017350ba_ffbc_b7cc_d218_9fcd56d32355["renderIterable()"]
  0e818d99_0299_a58a_f7c7_b3fe5a5b3548["any.ts"]
  017350ba_ffbc_b7cc_d218_9fcd56d32355 -->|defined in| 0e818d99_0299_a58a_f7c7_b3fe5a5b3548
  033d3df7_8875_dc4e_f964_c42d13fcdeef["renderChild()"]
  033d3df7_8875_dc4e_f964_c42d13fcdeef -->|calls| 017350ba_ffbc_b7cc_d218_9fcd56d32355
  033d3df7_8875_dc4e_f964_c42d13fcdeef["renderChild()"]
  017350ba_ffbc_b7cc_d218_9fcd56d32355 -->|calls| 033d3df7_8875_dc4e_f964_c42d13fcdeef
  style 017350ba_ffbc_b7cc_d218_9fcd56d32355 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/astro/src/runtime/server/render/any.ts lines 101–127

function renderIterable(
	destination: RenderDestination,
	children: Iterable<any>,
): void | Promise<void> {
	// although arrays and iterables may be similar, an iterable
	// may be unbounded, so rendering all children eagerly may not
	// be possible.
	const iterator = (children[Symbol.iterator] as () => Iterator<any>)();

	const iterate = (): void | Promise<void> => {
		for (;;) {
			const { value, done } = iterator.next();

			if (done) {
				break;
			}

			const result = renderChild(destination, value);

			if (isPromise(result)) {
				return result.then(iterate);
			}
		}
	};

	return iterate();
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does renderIterable() do?
renderIterable() is a function in the astro codebase, defined in packages/astro/src/runtime/server/render/any.ts.
Where is renderIterable() defined?
renderIterable() is defined in packages/astro/src/runtime/server/render/any.ts at line 101.
What does renderIterable() call?
renderIterable() calls 1 function(s): renderChild.
What calls renderIterable()?
renderIterable() is called by 1 function(s): renderChild.

Analyze Your Own Codebase

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

Try Supermodel Free