Closed patryk4815 closed 6 years ago
Sorry I didn't saw your issues, I will take a look tomorrow and come back to you. I will make a pr tomorrow to fix it. I don't resolve, reject the promise with the payload... 😞
@patryk4815 I fix the issue with the release 0.2.0 an example with redux form:
<form
onSubmit={handleSubmit(yourErrorHandler(onFormSubmit))}
>
with onFormSubmit which is your promiseActionCreator
for example:
export const loginRequest = promiseActionCreator(
loginActionRequest,
['LOGIN_SUCCESS', 'LOGIN_FAILURE'],
)
you can now follow the doc of the redux-form: https://redux-form.com/6.0.0-rc.1/examples/submitvalidation/ maybe you want something Like:
f({
payload,
}, dispatch).catch(e => {
// e is the payload of the action
throw new SubmissionError({ username: e, _error: 'Login failed!' })
})
How can i return errors to form :) ?