Skip to main content
Glama

MCP Svelte Docs Server

# enhance Definition **Definition:** Client-side helper to progressively enhance `<form>` submissions by calling actions via fetch and updating UI without a full navigation. **Syntax:** `import { enhance } from '$app/forms'` **Parameters:** - `use:enhance` — enhance a `<form method="POST">` - Callback (SubmitFunction): `({ action, formData, formElement, controller, submitter, cancel }) => ( { formData, formElement, action, result, update } ) => void` - `update({ reset?, invalidateAll? })` — run default post-submit behavior - Requires `method="POST"` and an action in `+page.server.*` **Returns:** Unsubscribable cleanup function. ## Example ```svelte <script lang="ts"> import { enhance } from '$app/forms'; let pending = false; </script> <form method="POST" use:enhance={({ action, formData, formElement, cancel, controller, submitter }) => { return async ({ result, update }) => { await update(); // default behavior (updates form/page.form, invalidates) }; }}> <!-- inputs --> </form> ``` ## Related - `actions`, `fail` - `$app/forms`

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/spences10/mcp-svelte-docs'

If you have feedback or need assistance with the MCP directory API, please join our Discord server