-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Open
Labels
area: formsgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by gemini
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
forms
Description
Currently the return type for the submit action of signal forms is defined as a promise, i.e., Promise<TreeValidationResult>, in
form(signal(state), submission: { action });or in
await submit(form, action);However, there are valid use cases for synchronous submission if no server action is required.
Proposed solution
Widen the return type to MaybePromise<TreeValidationResult> to accommodate both asynchronous and synchronous use cases.
Optionally, one could also consider inferring the return type of submit to be synchronous if the action is synchronous.
Alternatives considered
Actions can be written to return Promise.resolve(result).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: formsgemini-triagedLabel noting that an issue has been triaged by geminiLabel noting that an issue has been triaged by gemini