<Is this correct way to convert Flow to StateFlow?...
# stackoverflow
r
Is this correct way to convert Flow to StateFlow? I receive data from room Dao to repo to View Model in flow and then convert to stateFlow using stateIn. Is this the correct way to do it? Can we cache this flow using .cachedIn(viewModelScope)? I tried it didn't work. ViewModel- val mapData: StateFlow = combine( _visibleRegion, _zoomLevel, _isFavorite, ::Triple, ).flatMapLatest { (region, zoom, isFav) -> repo.getDataInBoundsPaged( region.southwest.latitude,...