Loaders and Actions
Vuloom uses plain module exports for route loaders and actions.
Route module shape
Use named exports in your route files:
export async function loader({ params }: { params: Record<string, string> }) {
return {
slug: params.slug,
};
}
export async function action({ formData }: { formData: FormData }) {
return {
ok: Boolean(formData.get("name")),
};
}
How they are used
loader()runs on the server to provide route dataaction()handles mutating requests for the route- the generated route runtime wires these exports into navigation, form submission, and SSR automatically