You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using with redux-saga a good trick is to return an empty Promise from the onSubmit function, like so:
constmapDispatchToProps=(dispatch)=>{return{onSubmit: (value)=>{dispatch({type: 'LOGIN_WITH_EMAIL',payload: {email: value.email,password: value.password}});returnnewPromise(()=>{});// sets form state to SUBMITTING}}}
Then in the saga, if the api call on the server fails, one would simply dispatch stopSubmit('LoginForm', { _error: error}).
All of this works for one submit. Subsequent attempts to submit are ignored because the submit promise returned by onSubmit remains undeleted (https://github.com/erikras/redux-form/blob/master/src/reduxForm.js#L407). Since the submit has stopped, shouldn't the submitPromise be cleared too?
This happens in any redux-form 6.* version.
The text was updated successfully, but these errors were encountered:
bug report
When using with redux-saga a good trick is to return an empty Promise from the onSubmit function, like so:
Then in the saga, if the api call on the server fails, one would simply dispatch
stopSubmit('LoginForm', { _error: error})
.All of this works for one submit. Subsequent attempts to submit are ignored because the submit promise returned by onSubmit remains undeleted (https://github.com/erikras/redux-form/blob/master/src/reduxForm.js#L407). Since the submit has stopped, shouldn't the submitPromise be cleared too?
This happens in any redux-form 6.* version.
The text was updated successfully, but these errors were encountered: