Skip to content
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

can not call DataSource function during an action #720

Open
linchen2chris opened this issue Jan 17, 2018 · 0 comments
Open

can not call DataSource function during an action #720

linchen2chris opened this issue Jan 17, 2018 · 0 comments

Comments

@linchen2chris
Copy link

During an action if we want call another action in turn, we can use xxActions.yy.defer()
But if During an action I want to call DataSource function, it will give error "cannot dispatch during an action"

How can I call DataSource function during an action?

The context is
I have a submit button, it should submit data by calling DataSource function, but before submit I wanna validate the data. so when click button, I send an action set the submitted flag and validate all data, if no error, I will call api to submit the data, if has error, won't call submit.

But I got error, Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant