Throttling large amount of actions in a short time span #612
Replies: 1 comment 1 reply
-
Im having the same issue understanding how to throttle actions in such situations, the task essential boils down to throttling the effects. However this does not seem to work. I have tried using .throttle, .debounce and using a .cancel. For some reason all of the returned effects fire all of the api requests. |
Beta Was this translation helpful? Give feedback.
-
We have a button that makes a network request upon tap, the tap coverts to a reducer action and an effect to fetch something from the network is returned in the reducer. We are trying to prevent a situation where the user can "spam" the button by tapping it multiple times in a short time span, essentially throttle the action. We thought that using .cancel + cancelInFlight: true would solve the issue, presuming if the user taps the button multiple times we essentially cancel the previous effect before it executes therefore getting just one network request. However this does not work. What would be the suggested approach?
Beta Was this translation helpful? Give feedback.
All reactions