Skip to content

Commit

Permalink
docs: add more clarity for getters in a module usage (#1874)
Browse files Browse the repository at this point in the history
close #1874
  • Loading branch information
kiaking committed Nov 25, 2020
1 parent 8d2ba4d commit 233b500
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/guide/modules.md
Expand Up @@ -85,7 +85,7 @@ const moduleA = {

## Namespacing

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.
By default, actions and mutations are still registered under the **global namespace** - this allows multiple modules to react to the same action/mutation type. Getters are also registered in the global namespace by default. However, this currently has no functional purpose (it's as is to avoid breaking changes). You must be careful not to define two getters with the same name in different, non-namespaced modules, resulting in an error.

If you want your modules to be more self-contained or reusable, you can mark it as namespaced with `namespaced: true`. When the module is registered, all of its getters, actions and mutations will be automatically namespaced based on the path the module is registered at. For example:

Expand Down

0 comments on commit 233b500

Please sign in to comment.