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 fire update if the top-level state doesn't change after a reducer #32

Open
LPGhatguy opened this issue Aug 2, 2018 · 2 comments

Comments

@LPGhatguy
Copy link
Contributor

This probably doesn't come up often in practice, but it seems like a fairly low-effort optimization for this case.

@OverHash
Copy link
Contributor

By top-level state are you referring to not checking recursively? That would make more sense as checking recursively can be quite costly.

Part of this issue is optimization, but it heavily depends on what's happening inside the .changed, for instance, if users manually check to see if the value they want has actually changed, this issue doesn't affect them (and would actually slow their code down), but otherwise, it could make a slight performance gain.

@ZoteTheMighty
Copy link
Contributor

If I understand correctly, the only time that this will be an improvement is if we're using the store and thunks to to trigger a side effect without actually changing any state, right? That seems too infrequent to be a concern, especially since lots of thunks will also dispatch more changes that do change the state before the next flush anyways.

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

Successfully merging a pull request may close this issue.

3 participants