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
I have just encountered a situation where I managed to get an infinite loop due to updating vuex state as part of an asynchronously computed property. In fairness I realise this is against the Vue principles but it is the only way I know of to display a global loading indicator.
It appears to be caused because the change to the loading state at the end triggers a new update.
I would like to be able to explicitly remove the $store as a watched variable, or explicitly list the properties I actually care about. I can achieve this with shouldUpdate by storing previous variables and checking if anything I care about changed, but that makes shouldUpdate change state which is also not good (and makes any explicit update() calls stop working).
If this is not a use-case you want to support, I suggest at least making sure there are not two invocations in-flight at the same time; if inputs change, it should wait until the current request has finished before starting a new one
The text was updated successfully, but these errors were encountered:
I have just encountered a situation where I managed to get an infinite loop due to updating vuex state as part of an asynchronously computed property. In fairness I realise this is against the Vue principles but it is the only way I know of to display a global loading indicator.
The basic setup:
Store setup:
This results in an infinite loop, where the next call is made before the first has entirely finished;
It appears to be caused because the change to the loading state at the end triggers a new update.
I would like to be able to explicitly remove the
$store
as a watched variable, or explicitly list the properties I actually care about. I can achieve this withshouldUpdate
by storing previous variables and checking if anything I care about changed, but that makesshouldUpdate
change state which is also not good (and makes any explicitupdate()
calls stop working).If this is not a use-case you want to support, I suggest at least making sure there are not two invocations in-flight at the same time; if inputs change, it should wait until the current request has finished before starting a new one
The text was updated successfully, but these errors were encountered: