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

Include an example of how to handle "runInNewContext: false" with store modules #807

Closed
jazoom opened this issue May 28, 2017 · 4 comments
Closed
Labels
documentation Improvements or additions to documentation

Comments

@jazoom
Copy link

jazoom commented May 28, 2017

What problem does this feature solve?

It is not immediately apparent that each store module needs to be a function that returns a fresh module, which needs to be combined with other store modules when the root store is created afresh.

The above sentence is really confusing. See discussion here to understand what I mean:

https://forum.vuejs.org/t/debugging-state-pollution-with-the-new-behaviour-of-vue-2-3-ssr/11724

What does the proposed API look like?

This is a documentation suggestion.

@ktsn
Copy link
Member

ktsn commented May 28, 2017

You need this section? https://vuex.vuejs.org/en/modules.html#module-reuse

@ktsn ktsn added the documentation Improvements or additions to documentation label May 28, 2017
@jazoom
Copy link
Author

jazoom commented May 28, 2017

Well, I don't need anything at the moment. @LinusBorg helped me to find out this was what I was missing and we thought it might be a good idea to add it to the documentation.

@ktsn
Copy link
Member

ktsn commented May 28, 2017

I mean there is a better approach to reuse store modules now (since Vuex v2.3) and it seems to be already documented.

@jazoom
Copy link
Author

jazoom commented May 28, 2017

Then maybe there should be a mention there that this is what is required for SSR to function properly when using runInNewContext: false? I still don't understand why this is better, though.

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

No branches or pull requests

2 participants