Skip to content

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

Description

@luthian

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions