You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We did not find any documentation of the behavior we encountered with the store's commit() method when working with a list of objects, so we do not know what to make of it.
It seems like any call to commit() persists all pending changes to the state, even if the method called in commit() does not do anything.
In the example below, when editing one of the fields and clicking "Commit nothing", the changes are persisted in the state, even though the store's doNothing() method did not do anything.
The Vuex "Mutations" page does not address this at all, hence we wonder, is this a bug or intended behavior?
In case of the latter, it should be documented and emphasized on the "Mutations" page, because it is very unintuitive.
The text was updated successfully, but these errors were encountered:
enloc-port
changed the title
Store.commit() persists all pending changes, independent from anything else
Store.commit() persists all pending changes on object lists, independent from anything else
Jan 3, 2023
enloc-port
changed the title
Store.commit() persists all pending changes on object lists, independent from anything else
[Vuex] Store.commit() persists all pending changes on object lists, independent from anything else
Jan 3, 2023
enloc-port
changed the title
[Vuex] Store.commit() persists all pending changes on object lists, independent from anything else
[Vuex] Store.commit() persists all pending changes on object lists, even if method does nothing
Jan 3, 2023
Version
Vue: 2.6.14
Vuex: 3.5.1
Description
We did not find any documentation of the behavior we encountered with the store's
commit()
method when working with a list of objects, so we do not know what to make of it.It seems like any call to
commit()
persists all pending changes to the state, even if the method called incommit()
does not do anything.In the example below, when editing one of the fields and clicking "Commit nothing", the changes are persisted in the state, even though the store's
doNothing()
method did not do anything.The Vuex "Mutations" page does not address this at all, hence we wonder, is this a bug or intended behavior?
In case of the latter, it should be documented and emphasized on the "Mutations" page, because it is very unintuitive.
Example
example.vue
store.js
The text was updated successfully, but these errors were encountered: