...
 
Commits (2)
## 4.0.1
- Cancel internal subscriptions on close
## 4.0.0
- Use new action dispatch pattern
......
......@@ -23,6 +23,8 @@ abstract class BlocStream<State> extends Stream<State> {
BehaviorSubject<State> _state$;
State get value => _state$.value;
StreamSubscription<State> _transformSubscription;
@override
bool get isBroadcast => _state$.isBroadcast;
......@@ -59,7 +61,7 @@ abstract class BlocStream<State> extends Stream<State> {
actions$.asyncExpand(transform);
void _bindActionsToStates() {
transformActions(
_transformSubscription = transformActions(
_actionController.stream,
_transformAction,
).listen((newState) {
......@@ -85,6 +87,7 @@ abstract class BlocStream<State> extends Stream<State> {
@mustCallSuper
Future<void> close() {
_closers.forEach((fn) => fn());
_transformSubscription.cancel();
_actionController.close();
return _state$.close();
}
......
name: bloc_stream
description: A simple package that helps you to implement the BLoC pattern in your applications.
version: 4.0.0
version: 4.0.1
homepage: https://gitlab.com/arisechurch/bloc_stream
environment:
......