---
import Header from '../components/Header.astro';
import AsyncEach from '../components/AsyncEach.astro';
import { wait } from '../wait';

async function * list() {
	const nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
	for(const num of nums) {
		await wait(15);
		yield num;
	}
}
---
<html>
<head><title>Testing</title></head>
<body>
<h1>Title</h1>
<section>
	<Header />
</section>

<div id="promise">{Promise.resolve(12)}</div>

<ul>
	<AsyncEach iterable={list()}>
		{(num: number) => (
			<li>Number: {num}</li>
		)}
	</AsyncEach>
</ul>
</body>
</html>
