Document `form().pending` in the remote functions
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 20.8k
- Forks
- 2.3k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 156
Description
Describe the problem
Until now, form submission pending state required customizing the use:enhance as documented in this tutorial.
I've personally created a svelte-form-enhanced library just to handle this issue.
This can now be achieved with form().pending, but is only mentioned in the multiple instances of a form section.
{#each await getTodos() as todo}
{@const modify = modifyTodo.for(todo.id)}
<form {...modify}>
<!-- -->
<button disabled={!!modify.pending}>save changes</button>
</form>
{/each}
Describe the proposed solution
I hope it is documented as an independent section.
- Disable form when there is a pending submission (avoid double click, double submission in the client)
- Show saving state as in the existing tutorial.
<script lang="ts">
import { addId } from './ids.remote';
</script>
<form {...addId}>
<fieldset disabled={!!addId.pending}>
<!-- form content goes here -->
</fieldset>
</form>
Alternatives considered
No response
Importance
nice to have
Additional Information
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the remote functions documentation at the existing “Multiple instances of a form” section and compare its form().pending example with the linked customizing use:enhance tutorial. Add an independent explanation covering pending submissions, disabled controls, and saving feedback; done means the remote functions docs clearly show these use cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100