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

Receive mutation doesn't add items in a "Vue-reactive" way #31

Open
luthian opened this issue Oct 15, 2020 · 0 comments
Open

Receive mutation doesn't add items in a "Vue-reactive" way #31

luthian opened this issue Oct 15, 2020 · 0 comments

Comments

@luthian
Copy link

luthian commented Oct 15, 2020

I'm using this package and the standard receive mutation appears to not be adding new items to the byId state in a "Vue-reactive" way. When I mapped the list getter to a computed value and used that as a v-model to a Vuetify combovox, the computed value was always empty even after the state.byId had been updated.

The README file says that the code generated for this mutation does this:
response.forEach(datum => Vue.set(state.byId, datum.id, datum));
but the project code in mutations.js does this:
response.forEach(datum => (state.byId[getKey(datum)] = datum));

Should the receive mutation be updated to use Vue.set? I can submit a pull request with this change.

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