Add README example using Vuex store modules#30
Open
hola-soy-milk wants to merge 1 commit intoxanf:masterfrom
Open
Add README example using Vuex store modules#30hola-soy-milk wants to merge 1 commit intoxanf:masterfrom
hola-soy-milk wants to merge 1 commit intoxanf:masterfrom
Conversation
Hi there! Thanks for this helpful package. I thought it might help to have an example showing how to set up shared mutations using a store module. What do you think? 😄
karladler
approved these changes
Apr 15, 2020
|
@xanf please merge |
|
@ramonh Did this actually work for you? I tried to do this like your PR is documenting but my application just loses scope of the mutation. |
Author
|
Hey @tance77! That's right, it worked for me. Hrm. Is it possible your store modules aren't namespaced? I noticed that mine are. |
|
They definitely are namespaced. auth.js export default {
namespaced: true,I wonder if it has to do with me dynamically importing my mutations as follows: const predicates = [];
Object.keys(modules).forEach(module => {
Object.keys(modules[module].mutations).forEach(mutation => {
predicates.push(module + "/" + mutation);
});
});Sample console log of the predicates array |
|
I figured it out. Your solution is correct. Thanks for the quick replies. Had do do with something I commented out to accommodate this library. |
Author
|
Oh hey, awesome! Nice one 👍 Glad it worked! It had been a while so I was digging into my code. :) |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Hi there!
Thanks for this helpful package.
I thought it might help to have an example showing how to set up shared mutations using a store module.
What do you think? 😄