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

fix: avoid resetting store state when registering a dynamic module #2

Merged
merged 3 commits into from Sep 1, 2023

Conversation

alecgibson
Copy link
Collaborator

At the moment, when registering a dynamic module, we call
resetStoreState() just to register the getters for the new module.

It seems unnecessary to reset the entire store state in this case, and
this actually also leads to other issues.

This change is based on the test case added in
vuejs#2201

The approach taken in this change is to refactor the getter registration
into its own function, and call that new method when registering a
dynamic module instead of resetting the store state.

alecgibson and others added 3 commits September 1, 2023 09:29
This reverts commit 704d43e, reversing
changes made to 7b024d8.
Fixes vuejs#2197

At the moment, when registering a dynamic module, we call
`resetStoreState()` just to register the getters for the new module.

It seems unnecessary to reset the entire store state in this case, and
this actually also leads to [other issues][1].

This change is based on the test case added in
vuejs#2201

The approach taken in this change is to refactor the getter registration
into its own function, and call that new method when registering a
dynamic module instead of resetting the store state.

[1]: vuejs#2197
@alecgibson alecgibson merged commit 812af70 into main Sep 1, 2023
1 check passed
@alecgibson alecgibson deleted the alternative-fix branch September 1, 2023 08:33
alecgibson added a commit that referenced this pull request Sep 1, 2023
This reverts commit 812af70, reversing
changes made to 03bed24.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants