Closed Walraz closed 6 years ago
Hey @Walraz !
Wow. This is the third request in this week for this feature! I'll try to add it this weekend.
Cool @christianmalek !
Maybe the onSuccess arguments should be in an object for cleaner code and access only the args you need.
onSuccess({ state, actionPayload })
or even onSuccess({ state, params, data })
this would be breaking changes to the current api, but say it will be a 5th enhancement argument to onSuccess in the future, it will be a hassle to access it.
Thanks for an awesome library!
That's true. I will consider this in v3. Thanks for your input!
@Walraz Please update vuex-rest-api to v2.10.0. I've added the {params, data}
as additional parameter in the onSuccess
and onError
functions.
I don't find a way to access the called action payload in a onSuccess cb.
Lets say I want to make a delete request with params in action
this.$store.dispatch('user/delete', { params: { id: 1 })
can we have a actionPayload argument in the onSuccess() for convenient accessing the params/data from the action payload.
thx!