What is the equivalent code for this live data transformation in StateFlow / SharedFlow?
val myLiveData: LiveData<MyLiveData> = Transformations
.switchMap(_query) {
if (it == null) {
AbsentLiveData.create()
} else {
repository.load()
}
Basically, I want to listen to every query changes to react what to return. So, anything similar to that using StateFlow / SharedFlow is welcome.