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.
 
                        
switchMapis deprecated inflowsand should use either offlatMap,transformortransformLatestto convert one type of flows to others. An example for that would beI guess you can use same logic for
StateFloworSharedFlows.