Closed razorfever closed 6 years ago
How your store looks like?
vue-wait already supports module namespaces. The first parameter is the namespace and it's optional.
Oh sorry. It seems I made a copy / paste error while making the example and did not even spot the first parameter. I have tried to use it without it in my code like one would use the normal mapActions.
So what if I want to use actions from multiple modules? Would this work:
import { mapWaitingActions } from 'vue-wait'
// ...
methods: {
...mapWaitingActions('users', {
getUser: 'loading the user',
updateUser: 'updating the user',
}),
...mapWaitingActions('posts', {
getPosts: 'loading the posts',
deletePost: 'deleting a post',
}),
},
mounted() {
// get the user data
this.user = this.getUser(this.userId);
this.posts = this.getPosts();
},
// ...
Sure this will work.
Ok. Thanks. Sorry for the inconvenience. Keep up the good work
Splitting a Vuex store in one of my projects into namespaced modules made me think of the following.
Current way to use vue-wait with namespaced Vuex modules seems to be: (Not documented btw.)
I think something like this would be more preferable:
Thanks.