Open Nazacheres opened 3 years ago
Im kinda fake closing it here https://github.com/jkrecek/home-controller-flutter/blob/c2b0ea3e1b46e5c971d71ba50f8a069182e5167d/lib/services/api_service.dart#L31
is it not enough?
It closes the previous subscription on the new call (if that's what you want - cool). Also on dispose, but I don't see where dispose is called. IMHO it should be explicitly controlled in bloc. Currently, if bloc is disposed it will keep shooting new events.
This will produce an uncontrolled stream. Create new Composite Stream, and dispose it in blocs @close.
https://github.com/jkrecek/home-controller-flutter/blob/c2b0ea3e1b46e5c971d71ba50f8a069182e5167d/lib/bloc/dashboard/dashboard_bloc.dart#L19