How to use flow with lazyColumn? `collectAsState()...
# compose
k
How to use flow with lazyColumn?
collectAsState()
or adding each element in a local
MutableSnapshotList
using something like
onEach
or
collect { }
I guess you'd use
Flow<List<T>>
in the dao instead of
Flow<T>
to get all the items
g
collectAsState
feels more idiomatic. Adding to the snapshot list feels like trying to fit imperative habits into it 🤷‍♂️ That's my opinion though
k
Yes. I was looking for a list being updated in real-time and with Room's support for
Flow<List<T>>
and compose's
collectAsState
I was easily able to achieve the same