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

Don't call Action while ComputedValue is computing #2428

Closed
wants to merge 1 commit into from

Conversation

MoonBall
Copy link
Contributor

@MoonBall MoonBall commented Aug 11, 2020

Warn when calling action while ComputedValue is computing. This PR is related to #2346.

Code change checklist

  • Added/updated unit tests
  • Updated changelog
  • Updated /docs. For new functionality, at least API.md should be updated
  • Verified that there is no significant performance drop (npm run perf)

@gitpod-io
Copy link

gitpod-io bot commented Aug 11, 2020

@mweststrate
Copy link
Member

In general, it is not forbidden to call actions from computed values in MobX, although there are tricky edge cases, the tricks people pull otherwise to avoid the limitation are even worse. Thanks for the attempt though!

@MoonBall
Copy link
Contributor Author

Thank you for your explanation. I learn more after I understand the sentence "anything done in an action will not be tracked by the computed" you said.

@mweststrate mweststrate deleted the no-actions-when-is-computing branch September 19, 2020 11:18
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

Successfully merging this pull request may close these issues.

None yet

2 participants