calling distinct seems to make stream no longer a broadcast stream
Andersmholmgren opened this issue · comments
Andersmholmgren commented
e.g.
EventStream _createReloadStream(Property<bool> isActive,
Property<bool> isDirty,
ControllableEventStream reloadRequestedStream) {
final aAndD = isActive.and(isDirty).where((b) => b).asStream().distinct();
aAndD.listen((_) => print('dirty and active')); // prints
aAndD.listen((_) => print('dirty and active2')); // never printed
...
changing aAndD to
final aAndD = isActive.and(isDirty).where((b) => b).asStream().distinct().asBroadcastStream();
fixes the problem, but surely that shouldn't be required. I can't see a valid use case for FRP with non broadcast streams. And changing from broadcast to non broadcast when calling distinct is not intuitive to me so guessing it is a bug
Dan Schultz commented
I have a feeling this is related to #17
Dan Schultz commented
Closing. This is a dup of #17.