https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
My state for a module looks like this:
const state = {
loaded: false,
items: new Map(),
}
I'm having some issues when updating an item in the list through a mutation, that it doesn't propagate through to the Vue component. In the component I have:
computed: {
item() {
return this.$store.state.module.items.get(this.pk)
},
},
Am I using this wrong, or does Vuex not support Map()? If it's not supported, where would be a good place to put a load(pk) method?
Hi, thanks for your interest in the project.
The problem is twofold:
Is there a way to use Map and Set with vue/vuex and some boilerplate, or is it just not supported at all?
Most helpful comment
Is there a way to use Map and Set with vue/vuex and some boilerplate, or is it just not supported at all?