Hello @felangel .
On the Bloc, in search mode I overide the transformation event like this
return super.transformEvents (
events.debounceTime (const Duration (milliseconds: 500)),
transitionFn,
);
now I am using Cubit, currently in my Ui layer i have this
Timer _debounce;
_onSearchChanged () {
if (_debounce? .isActive ?? false) _debounce.cancel ();
_debounce = Timer (const Duration (milliseconds: 500), () {
// do something with MyCubit
});
}`
I ask for your best and most effective advice.
Thank You.
Hi @docmobile17 馃憢
For more advanced functionality like debouncing it is recommended to swap cubit for bloc, since it's pretty trivial to acomplish this in transformEvents, like you already mentioned. 馃憤
Hi @docmobile17 馃憢
For more advanced functionality like debouncing it is recommended to swap cubit for bloc, since it's pretty trivial to acomplish this in
transformEvents, like you already mentioned. 馃憤
Ok, Thank's for your advice @felangel and @RollyPeres 馃憤
Most helpful comment
Ok, Thank's for your advice @felangel and @RollyPeres 馃憤