import { createAsync, type RouteDefinition } from '@solidjs/router';
import { For } from 'solid-js';
import { getSeasons } from '~/api/server';
export const route = {} satisfies RouteDefinition;
export default function Home() {
const seasons = createAsync(async () => getSeasons(), { deferStream: true });
return (
<main class='w-full p-4 space-y-2'>
<h3 class='font-bold text-xl'>Hello world!</h3>
<For each={seasons()}>{(season) => <p>{season.title}</p>}</For>
</main>
);
}
import { createAsync, type RouteDefinition } from '@solidjs/router';
import { For } from 'solid-js';
import { getSeasons } from '~/api/server';
export const route = {} satisfies RouteDefinition;
export default function Home() {
const seasons = createAsync(async () => getSeasons(), { deferStream: true });
return (
<main class='w-full p-4 space-y-2'>
<h3 class='font-bold text-xl'>Hello world!</h3>
<For each={seasons()}>{(season) => <p>{season.title}</p>}</For>
</main>
);
}