Describe the bug
I have this situation, where users can update the cart by pressing the add/remove button, so I added a debounce timer on the event stream.
The problem I'm facing with this,
Here's the debounce timer for events:
@override
Stream<Transition<CloudCartBlocEvent, CloudCartBlocState>> transformEvents(
Stream<CloudCartBlocEvent> events, transitionFn) {
return super.transformEvents(
events.debounceTime(
Duration(
milliseconds: 250,
),
),
transitionFn);
}
Hi @adar2378 馃憢
You probably want to throttleTime cart events instead of debounceTime.
As for debouncing states you can override transformTransitions:
@override
Stream<Transition<Event, State>> transformTransitions(
Stream<Transition<Event, State>> transitions,
) {
return transitions.debounceTime(Duration(seconds: 1));
}
Hope that helps 馃憤
Thanks as always @RollyPeres!
@adar2378 closing for now but feel free to comment with additional questions and I鈥檓 happy to continue the conversation 馃憤
Most helpful comment
Thanks as always @RollyPeres!
@adar2378 closing for now but feel free to comment with additional questions and I鈥檓 happy to continue the conversation 馃憤