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
Is your feature request related to a problem? Please describe...
It is not related to a problem. In pure Vue + Vuex setups, I normally define "pending flags" in each module's state. These pending flags are used to track whether an API call is in progress, for example fetchingUserPending. I set these to false at the beginning of an action and to true in both the .then and .catch callbacks.
Describe the solution you'd like
I would be nice to have default pending flags defined for each model and each api call type in the Vuex ORM database, which are then controlled by the Vuex ORM axios plugin. Examples would be: fetchingPending, updatingPendingetc.
Describe alternatives you've considered
Manually adding state variables like this
class User extends Model {
static entity = 'users'
static state () {
return {
fetching: false
}
}
static fields () {
return { ... }
}
}
I absolutely agree that there is a lot of boilerplate code when it comes to dealing with supplementary states with requests and I understand the frustrations.
This is something we have given a lot of thought, and there is some light at the end of the tunnel in regards to finding a solution that represents all possible use-cases. Generally, though, the state management for this plugin is somewhat hindered by the limitations imposed by the core library but that too will change in an upcoming core release.
We’ll keep this issue open for community driven ideas to find an adequate solution to this particular issue.
Is your feature request related to a problem? Please describe...
It is not related to a problem. In pure Vue + Vuex setups, I normally define "pending flags" in each module's state. These pending flags are used to track whether an API call is in progress, for example
fetchingUserPending
. I set these to false at the beginning of an action and to true in both the.then
and.catch
callbacks.Describe the solution you'd like
I would be nice to have default pending flags defined for each model and each api call type in the Vuex ORM database, which are then controlled by the Vuex ORM axios plugin. Examples would be:
fetchingPending
,updatingPending
etc.Describe alternatives you've considered
Manually adding state variables like this
and updating them whenever doing an api call:
This is quite cumbersome, it kind of defeats the whole purpose of using this plugin since I might as well manually define actions.
The text was updated successfully, but these errors were encountered: