Kirill Prybylsky
02/13/2020, 9:17 AMalex009
02/13/2020, 11:42 AMEventsDispatcher
https://github.com/icerockdev/moko-mvvm#viewmodel-with-send-events-to-view
good approach - interface much better than separated event classes for every actionRonald van D
02/13/2020, 1:14 PMLoginAcceptable
. The post in the livedata is actually just a method call on that View. But what happens on a configuration change? Then the view is recreated but the viewmodel will hold an old reference. You should not hold a reference of your view in the viewmodel. I like to use sealed classes for this.Kirill Prybylsky
02/13/2020, 1:17 PMalex009
02/13/2020, 1:27 PMRonald van D
02/13/2020, 1:28 PMKirill Prybylsky
02/13/2020, 1:31 PMalex009
02/13/2020, 1:34 PMKirill Prybylsky
02/13/2020, 1:35 PMalex009
02/13/2020, 1:37 PMKirill Prybylsky
02/13/2020, 1:37 PMmng
02/13/2020, 5:43 PMSingleLiveEvent
is also an option for firing an event once and not hanging on to a reference of it. Only catch is there can be only one Observer