Being a complete novice I can't seem to figure this out. I had:
Stream<ActivityEvent> transform(Stream<ActivityEvent> events) {
return (events as Observable<ActivityEvent>)
.debounce(Duration(milliseconds: 500));
}
In earlier version which worked perfect, however now I'm getting both:
Any help would be much appreciated, at total loss why this happens (have tried to read the change logs but not skilled enough to get it)
Hi @Luppakorva 馃憢
Thanks for opening an issue!
There are two transforms in v4.0.0 (transformEvents
and transformTransitions
).
In your case, you can replace your code with:
@override
Stream<Transition<ActivityEvent, ActivityState>> transformEvents(
Stream<ActivityEvent> events,
TransitionFunction<ActivityEvent, ActivityState> transitionFn,
) {
return super.transformEvents(
events.debounceTime(const Duration(milliseconds: 500)),
transitionFn,
);
}
Hope that helps 馃憤
Thank you so much for the quick reply and sorry to bother with a follow up,
events.debounceTime is not playing ball, instead getting:
error: The method 'debounceTime' isn't defined for the type 'Stream'.
Any chance you could hint me to right direction why this happens?
You need to make sure you add rxdart as a dependency and import it.
Many many thanks! You saved my night :).
Most helpful comment
Many many thanks! You saved my night :).