This repository was archived by the owner on Feb 10, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +5
-22
lines changed Expand file tree Collapse file tree 5 files changed +5
-22
lines changed Original file line number Diff line number Diff line change @@ -135,8 +135,6 @@ extension AggregateSample<T> on Stream<T> {
135
135
} else {
136
136
triggerSub! .pause ();
137
137
}
138
- // Handle opt-out nulls
139
- cancels.removeWhere ((Object ? f) => f == null );
140
138
if (cancels.isEmpty) return null ;
141
139
return cancels.wait.then ((_) => null );
142
140
};
Original file line number Diff line number Diff line change @@ -78,10 +78,7 @@ extension AsyncExpand<T> on Stream<T> {
78
78
}
79
79
controller.onCancel = () {
80
80
if (subscriptions.isEmpty) return null ;
81
- var cancels = [for (var s in subscriptions) s.cancel ()]
82
- // Handle opt-out nulls
83
- ..removeWhere ((Object ? f) => f == null );
84
- return cancels.wait.then ((_) => null );
81
+ return [for (var s in subscriptions) s.cancel ()].wait.then ((_) => null );
85
82
};
86
83
};
87
84
return controller.stream;
Original file line number Diff line number Diff line change @@ -128,9 +128,7 @@ extension CombineLatest<T> on Stream<T> {
128
128
var cancels = [
129
129
sourceSubscription! .cancel (),
130
130
otherSubscription! .cancel ()
131
- ]
132
- // Handle opt-out nulls
133
- ..removeWhere ((Object ? f) => f == null );
131
+ ];
134
132
sourceSubscription = null ;
135
133
otherSubscription = null ;
136
134
return cancels.wait.then ((_) => null );
@@ -230,11 +228,7 @@ extension CombineLatest<T> on Stream<T> {
230
228
}
231
229
controller.onCancel = () {
232
230
if (subscriptions.isEmpty) return null ;
233
- var cancels = [for (var s in subscriptions) s.cancel ()]
234
- // Handle opt-out nulls
235
- ..removeWhere ((Object ? f) => f == null );
236
- if (cancels.isEmpty) return null ;
237
- return cancels.wait.then ((_) => null );
231
+ return [for (var s in subscriptions) s.cancel ()].wait.then ((_) => null );
238
232
};
239
233
};
240
234
return controller.stream;
Original file line number Diff line number Diff line change @@ -90,11 +90,7 @@ extension Merge<T> on Stream<T> {
90
90
}
91
91
controller.onCancel = () {
92
92
if (subscriptions.isEmpty) return null ;
93
- var cancels = [for (var s in subscriptions) s.cancel ()]
94
- // Handle opt-out nulls
95
- ..removeWhere ((Object ? f) => f == null );
96
- if (cancels.isEmpty) return null ;
97
- return cancels.wait.then ((_) => null );
93
+ return [for (var s in subscriptions) s.cancel ()].wait.then ((_) => null );
98
94
};
99
95
};
100
96
return controller.stream;
Original file line number Diff line number Diff line change @@ -124,9 +124,7 @@ extension SwitchLatest<T> on Stream<Stream<T>> {
124
124
var cancels = [
125
125
if (! outerStreamDone) outerSubscription.cancel (),
126
126
if (sub != null ) sub.cancel (),
127
- ]
128
- // Handle opt-out nulls
129
- ..removeWhere ((Object ? f) => f == null );
127
+ ];
130
128
if (cancels.isEmpty) return null ;
131
129
return cancels.wait.then (_ignore);
132
130
};
You can’t perform that action at this time.
0 commit comments