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

Check for store changes before firing.changed #53

Closed
wants to merge 5 commits into from
Closed

Check for store changes before firing.changed #53

wants to merge 5 commits into from

Conversation

OverHash
Copy link
Contributor

This PR closes #32

However, more discussion needs to be done around this (e.g. this is quite a costly operation, do we want to really run it by default? do we want to run it recursively)

@coveralls
Copy link

coveralls commented Jul 13, 2020

Coverage Status

Coverage decreased (-0.5%) to 98.857% when pulling 1ed7417 on OverHash:master into efda50f on Roblox:master.

@github-actions
Copy link

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@ZoteTheMighty
Copy link
Contributor

I think the reason that #32 suggests checking only the top-level store values is because reducers should always honor data immutability anyways. If any value changed anywhere in the store, a correctly built set of reducers will result in a change in one of the top-level state fields.

Going through this recursively feels like we're optimizing for an incorrect usage and paying a performance cost for it, so it doesn't sit well with me. I left a comment on #32 to this effect, but I think I'm unconvinced that this is even worth checking at all, even if we compare shallowly.

@OverHash
Copy link
Contributor Author

OverHash commented Jan 9, 2021

Yep, I agree. Closing this PR.

@OverHash OverHash closed this Jan 9, 2021
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.

Don't fire update if the top-level state doesn't change after a reducer
3 participants