Skip to content

Use Vue.set for adding items to state.keyedById in the `addItems` mutation

Compare
Choose a tag to compare
@marshallswain marshallswain released this 01 Dec 04:00
· 584 commits to master since this release

This modifies the service plugin’s addItems mutation to prevent overwriting all of keyedById and tempsById. When queries are made using data derived from the store, since the addItems mutation was overwriting the entire keyedById object, the query would run again. These infinite loops were running even if you used a computed property as a go-between to cache the parts of the query derived from the store.

In scenarios where the query uses data derived from the store and then updates the store when results arrive, this change allows using a computed property to properly cache and prevent infinite loops.