Skip to content

Documentation Clarity for Getters in Vuex Modules #1874

Closed
@jmcooper

Description

@jmcooper

Version

4.0.0-rc.1

Reproduction link

https://vuex.vuejs.org/guide/modules.html#namespacing

Steps to reproduce

This is a problem with the documentation.

What is expected?

Greater clarity on getters in Vuex modules

What is actually happening?

In the namespacing section there is this explanation for why getters, actions and mutations are not namespaced by default:
"By default, actions, mutations and getters inside modules are still registered under the global namespace - this allows multiple modules to react to the same mutation/action type."

That reasoning (allowing multiple modules to react) is true for mutations an actions, but it doesn't explain the purpose for getters. In fact, it feels inaccurate to be grouping getters into this reasoning since it's actually erroneous to suggest you can have getters with the same name in multiple non-namespaced modules (or root) when that, in fact, will produce an error.


What is the purpose for a module's getters being global by default? If there is a purpose, can it be included here in the documentation?

Metadata

Metadata

Assignees

Labels

3.x4.xdocumentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions