Could use a Flow<T> to replace a LiveData?
# coroutines
d
Could use a Flow<T> to replace a LiveData?
Or maybe I should wire the LiveData's active status to the Flow<T>.
e
ConflatedBroadcastChannel
is a better replacement for
LiveData
. Maybe we should give it a short and more catchy name?
👍 7
d
@elizarov You sir are a genius and have given me an idea! I can open a subscription to the
BroadcastChannel
when the `LiveData`'s status changes to active and close the subscription when the status is not active!
This is just amazing!
f
Are there any limitations on number of channels created at a time (regarding system performance) ? How expensive is channel creation compared to LiveData ?
d
I would have a only a single LiveData to hold the entire state of the view, so only 1 channel is needed for that.
It would not be very costly.