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

Display warning if root state property has the same name with module #1363

Closed
hootlex opened this issue Aug 3, 2018 · 1 comment · Fixed by #1365
Closed

Display warning if root state property has the same name with module #1363

hootlex opened this issue Aug 3, 2018 · 1 comment · Fixed by #1365
Assignees
Labels
enhancement New feature or request

Comments

@hootlex
Copy link
Member

hootlex commented Aug 3, 2018

What problem does this feature solve?

If there is a root state property with the same name of a module, the module is prioritized. Right now there is no warning.

Example:

// store
modules: {
    users
},
state: {
    users: []
}

store.state.users points to the users module and users state property is shallowed

What does the proposed API look like?

There should be a warning pointing out the mistake and intriguing the user to rename the state property.

@winniehell
Copy link

A similar warning has been implemented in #1554.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants