If `Flow` is stream and `shared (state) flow` is ...
# coroutines
i
If
Flow
is stream and
shared (state) flow
is hot stream can i somehow sent
completion
event through?
g
In general completion event is CancellationException propagated as error, but how you do it depends on flow implementation StateFlow implementation is not cancellable, shared flow can be cancellable, depending on implementation
c
.takeWhile { }
or
.transformWhile { }
is useful for exactly this purpose, emitting values downstream while some condition remains true. You can use it to check that the upstream values are not the “completion token”.
g
Yep, the only thing you cannot expose StateFlow, those extensions create Flow