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

Dynamic namespaces in binding helpers (mapState, …) #1545

Closed
ThomasKientz opened this issue May 2, 2019 · 1 comment
Closed

Dynamic namespaces in binding helpers (mapState, …) #1545

ThomasKientz opened this issue May 2, 2019 · 1 comment

Comments

@ThomasKientz
Copy link

What problem does this feature solve?

With this feature we can use a prop for setting a namespace :

...mapState(this.namespace, ['filter'])

Actually we got the error :

Cannot read property 'namespace' of undefined

In my app I am dynamically registering store modules with generated on the fly namespaces. And I am passing the namespace as component properties.

Right now I have to do :

filter() { // more verbose but working
      return this.$store.state[this.namespace].filter
}

which is more verbose.

related stackoverflow issue : https://stackoverflow.com/questions/55927452/vuex-dynamic-namespaces-in-binding-helpers-mapstate

What does the proposed API look like?

...mapState(this.namespace, ['filter'])

@ThomasKientz
Copy link
Author

solved here : #863 (comment)

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