Replace SingleLiveEvent with kotlin Channel / Flow

Photo by Mihai Moisa on Unsplash

After the announcement of the StateFlow implementation this year, I got curious about the possibility to totally replace LiveData. This means one less project dependency and achieve a more independent code from Android framework.

StateFlow is not the subject of this post but we can change the view states represented by a LiveData using a StateFlow. For SingleLiveEvent class…