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
Well basically as the title mentions. I'm trying to do an optimistic update to a counter but since the onQueryStarted is getting triggered twice I end up with a wrong value.
Alternatively, since I'm in the development stage I've been using the Tags but is not the best performant option for Prod.
Goal
Update the user counting by reducing it by one 'cause I'm removing only one user.
Actual Result
So in the case, I have 10 users result should be 9 but I'm getting 8 as result of onQueryStarted 'cause it's getting called twice
The text was updated successfully, but these errors were encountered:
As the guide mentions, I went first to StackOverflow so for Context and Code go to: https://stackoverflow.com/questions/78329782/onquerystarted-rtk-query-triggers-twice
Well basically as the title mentions. I'm trying to do an optimistic update to a counter but since the
onQueryStarted
is getting triggered twice I end up with a wrong value.Alternatively, since I'm in the development stage I've been using the Tags but is not the best performant option for Prod.
Goal
Update the user counting by reducing it by one 'cause I'm removing only one user.
Actual Result
So in the case, I have 10 users result should be 9 but I'm getting 8 as result of onQueryStarted 'cause it's getting called twice
The text was updated successfully, but these errors were encountered: