You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you switch the line comments as I mentioned above, you can notice that while the getters work to target the right state information, the modules states are not correctly nested. Look at my todos module's state, the tasks there is actually the state of a nested submodule with the namespace todos/tasks/. todos/otherTasks is another module, that looks nested, but is not.
The todos/tasks/ module obeys the desired behavior for nested modules because an array is passed as the namespace to store.registerModule(), something that currently is not possible with feathers-vuex.
For a more in-depth look, I added a breakpoint after these lines so you can see the inner workings of the vuex module:
FWIW, the logic for resolving getters according to namespaces is the same regardless of whether a single string or an array is used, so this app continues to work even when the child modules are not really children, but there may be points at which this behavior breaks down.
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
NodeJS version:
Observed on node@8.2.1, node@6.11.1 Operating System:
Os X Sierra 10.12.6 Browser Version:
Chrome 61.0.3163.31 (Official Build) beta (64-bit)
The text was updated successfully, but these errors were encountered:
Steps to reproduce
You cannot provide string array namespaces to feathers-vuex.
I've made an example repo here: https://github.com/jskrzypek/feathers-chat-vuex/tree/array-namespaces. If you clone & install from this branch the app will fail.
You can swap the commented line here to make it work:
https://github.com/jskrzypek/feathers-chat-vuex/blob/array-namespaces/src/api/feathers-client.js#L25-L26
While it's working you can inspect the vuex store with
vue-devtools
and see that it looks something like this:Expected behavior
Providing namespaces as arrays should allow the user to create service-modules at arbitrarily deep levels of module nesting as described here: https://github.com/vuejs/vuex/blob/dd7f8178d93e6121a447c410b9c652f40cd80937/docs/en/modules.md#dynamic-module-registration
Actual behavior
When you switch the line comments as I mentioned above, you can notice that while the getters work to target the right state information, the modules states are not correctly nested. Look at my
todos
module's state, thetasks
there is actually the state of a nested submodule with the namespacetodos/tasks/
.todos/otherTasks
is another module, that looks nested, but is not.The
todos/tasks/
module obeys the desired behavior for nested modules because an array is passed as the namespace tostore.registerModule()
, something that currently is not possible withfeathers-vuex
.For a more in-depth look, I added a breakpoint after these lines so you can see the inner workings of the vuex module:
FWIW, the logic for resolving getters according to namespaces is the same regardless of whether a single string or an array is used, so this app continues to work even when the child modules are not really children, but there may be points at which this behavior breaks down.
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
NodeJS version:
Observed on node@8.2.1, node@6.11.1
Operating System:
Os X Sierra 10.12.6
Browser Version:
Chrome 61.0.3163.31 (Official Build) beta (64-bit)
The text was updated successfully, but these errors were encountered: