How to use LiveDataScope in viewModel more than once?
In a part of the tutorial, I got the values of a list from the server using LiveDataScope and emit it and it works fine.
Now I want to refresh the list again with SwipeRefreshLayout but I don't know how to do it.
Actually I want to reuse liveDataScope code to refresh the list.
I read android docs about liveDataScope, If I understand correctly If liveData completed successfully, it doesn't restart.
In this case I don't know exactly what to do.
ViewModel :
val distanceLiveData: LiveData
=...