-
-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Promise support for onSubmit #28
Comments
This is super interesting. I'll start looking into the possibilities in the code and keep you up to date here. |
At this state, submit = (v, s, p, f) => submit(v).then(f.resetForm) |
Feathers? Wha do you mean?
…On Tue, Mar 21, 2017 at 3:25 PM Chuan Miao ***@***.***> wrote:
I smell feathers here :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#28 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFUmCVanFycesInBw8LeDl2-UogQvy_xks5roEBRgaJpZM4Ll_fu>
.
|
It is a light joke, I deleted it, because feathersjs is not so popular that everyone will get it :) But this is the background This proposal will make And I think @marshallswain is one of the authors of feathersjs. |
As a feathers user, I am most definitely in favour! |
Working on getting V2 rolled out soon. This supports Asynchronous validation. Stay tuned! |
Async validation now supported! |
It appears async submit is now supported, too! (Similar to the proposal found in this issue.) |
I've put some more thought into async support and have identified another area where it would be very useful. It would be nice to have Promise support built into form.js, here: https://github.com/tannerlinsley/react-form/blob/master/src/form.js#L137
So,
onSubmit
could accept a function that returns a promise. We could create two lifecycle methods for handling the promise.onSubmitSuccess
would run if the promise resolves.onSubmitError
would run if the promise is rejected.Adding promise support to
onSubmit
would also make it possible to support standardized error messages from the server. So the server could send back an error object with amessage
property that could show up in the UI, automatically.The text was updated successfully, but these errors were encountered: