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

How to avoid vuex over reactivity? #1629

Closed
Sociopacific opened this issue Oct 11, 2019 · 1 comment
Closed

How to avoid vuex over reactivity? #1629

Sociopacific opened this issue Oct 11, 2019 · 1 comment

Comments

@Sociopacific
Copy link

Sociopacific commented Oct 11, 2019

What problem does this feature solve?

If the getter returns an object or an array, this causes a recalculation of the properties that depend on this getter, even if the data in the object that returned the getter did not change. Can I somehow return the result of a previous getter calculation if the data has not really changed?

What does the proposed API look like?

someGetter(state, getters, rootState, rootGetters, oldValue) { ... if (JSON.stringify(result) === JSON.stringify(oldValue)) return oldValue; return result; }

@ktsn
Copy link
Member

ktsn commented Nov 9, 2019

For usage questions, please use the following resources:

  • Ask on the forums
  • Ask on the chat
  • Look for / ask questions on Stack Overflow

@ktsn ktsn closed this as completed Nov 9, 2019
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

2 participants