Join Slack
Powered by
i want to use it like flowOf<Int>().onEmpty{...
# coroutines
m
myanmarking
03/17/2020, 1:07 PM
i want to use it like flowOf<Int>().onEmpty{ emit(0) }, sth like this
s
streetsofboston
03/17/2020, 1:47 PM
You can do an action when it is empty like that, but you can’t emit another value over a finished Flow.
a
araqnid
03/17/2020, 3:56 PM
it’s fine here, because his onEmpty is actually creating a new flow wrapping around the upstream one (rather than firing on an event, like onComplete)
3
Views
Open in Slack
Previous
Next