Is anyone using `Flow` instead of `LiveData`? I'd ...
# coroutines
k
Is anyone using
Flow
instead of
LiveData
? I'd like to use flow for everything but I don't know of any catches that Flow may have since I'm pretty inexperienced with it.
m
This is probably more #android topic, but I think that by using Flow you miss the biggest advantage of LiveData - Lifecycle awareness. When activity restarts after configuration change (for example after device rotation), LiveData automatically emits previous value without any computational overhead. Flow would resubscribe and need to recompute the value.
d
You should be able to wrap
LiveData
in a
Flow
d
you can set the coroutine scope of the flow to the one provided by the lifecyle.