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

Module state called twice #1058

Open
afwn90cj93201nixr2e1re opened this issue Sep 1, 2019 · 7 comments
Open

Module state called twice #1058

afwn90cj93201nixr2e1re opened this issue Sep 1, 2019 · 7 comments

Comments

@afwn90cj93201nixr2e1re
Copy link

Version

5.1.1

Browser and OS info

Any

Steps to reproduce

vuejs/vuex#1118 (comment)

There twice calls too, like in vuejs/vuex@40874d8 which fixed by @ktsn

https://github.com/vuejs/vue-devtools/blob/9630d1a8fd0a0477dbb3c3d3f1b2849d00739717/src/backend/vuex.js#L238
https://github.com/vuejs/vue-devtools/blob/9630d1a8fd0a0477dbb3c3d3f1b2849d00739717/src/backend/vuex.js#L256

What is expected?

Get state directly from vuex module state which already initialized in registerModule.

What is actually happening?

...

@afwn90cj93201nixr2e1re
Copy link
Author

676e5e5#r34907936

Some suggestion.

@afwn90cj93201nixr2e1re
Copy link
Author

Also we should done this after module register.
We should refactor vuex event's if it doesnt have pre/post events.

@LinusBorg ping. What do you think about this?

@afwn90cj93201nixr2e1re
Copy link
Author

So, i fixed this
изображение

изображение

But idk about should we fix second one too, or no.

@Akryum @yyx990803.

@afwn90cj93201nixr2e1re
Copy link
Author

So, seems like it's not 100% fix, coz if we gonna update page with f5, then fix works as expected. But if we gonna change routes, after vue-devtools already initialized then we gonna get first call from vue-devtools, but then another call from vuex store.

@Akryum vue-devtools must give priority to vuex, and should get states after vuex dynamic module initializing.

@afwn90cj93201nixr2e1re
Copy link
Author

First load after page update, everything as expected:
изображение

If we already have initialized vue-devtools at this page:
изображение

As you can see, on second screenshot vue-devtools call state before vuex, but doesnt.

@afwn90cj93201nixr2e1re
Copy link
Author

Seems like a problem right here:
https://github.com/vuejs/vue-devtools/blob/dev/src/backend/vuex.js#L52-60

So, just change order, call original before calling proxy.

@afwn90cj93201nixr2e1re
Copy link
Author

If someone also need this one, just download, recompile for yourself or jus

t install extension(it's only for mozilla).
vuejs_devtools-5.1.1-an+fx.zip
vuex.zip

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

No branches or pull requests

1 participant