-
Couldn't load subscription status.
- Fork 24
Open
Labels
enhancementEnhances existing functionality.Enhances existing functionality.good first issueGood for newcomers.Good for newcomers.
Milestone
Description
What
I suggest to make the return statement of form.submit() unified for all its branching.
Why
Current behavior
Now calling form.submit() returns two different things based on the validity of a form:
- Returns
undefinedif a form is invalid. - Returns
Promise<response>after the dispatchedaction.
Expected behavior
Calling form.submit() always returns a Promise, which executes its .catch() chain if a form is invalid or its action Promise rejects, and returns the async action in the .then() call if its valid (as it does now).
Watch out for the call signature of those scenarios. When a form is invalid, it may expose a different set of argument to the
.catch()hook, then if the async action rejects. Can this be unified as well?
Metadata
Metadata
Assignees
Labels
enhancementEnhances existing functionality.Enhances existing functionality.good first issueGood for newcomers.Good for newcomers.