https://kotlinlang.org logo
d

dewildte

03/29/2021, 11:12 PM
Ok so I think the answer to this is yes but is it unsafe to have a
ViewModel
collect from a
Flow<T>
given to it by a
View
,
Activity
or
Fragment
? I.E.
Copy code
// MyView.kt
val events: Flow<Event> = flowOf(Event1, Event2)

viewModel.handleEvents(events)