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

registerModule causing unneccesary getter evaluations #1479

Open
brophdawg11 opened this Issue Jan 2, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@brophdawg11
Copy link

brophdawg11 commented Jan 2, 2019

Version

3.0.1

Reproduction link

https://codesandbox.io/s/kkrn0zojqr

Steps to reproduce

  • Open the code sandbox
  • Open the console
  • Reload the sandbox and note the log of "Running Getter"
  • Click Register Module
  • Note that "Running Getter" is logged again, even though state.foo hasn't changed

What is expected?

Just like normal reactivity, I wouldn't expect the foo getter to re-run unless one of it's dependencies (state.foo) was changed.

What is actually happening?

Calling registerModule causes getters to re-execute regardless


This is more noticeable and more problematic if the getters return non-primitives, since they can then trigger re-renders down the component tree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment