Pablo
val uiState: StateFlow<BusStopsDBScreenUiState> = busDataRepository.getBusStops() .map<List<BusStop>, BusStopsDBScreenUiState> { busStops -> BusStopsDBScreenUiState.Success(busStops, Res.string.bus_stops_db_filled) } .catch { throwable -> emit(BusStopsDBScreenUiState.Error(throwable)) }.stateIn(viewModelScope, SharingStarted.WhileSubscribed(5000), BusStopsDBScreenUiState.Loading)
@Query("SELECT * FROM BusStops") fun getBusStops(): Flow<List<BusStopEntity>>
Seri
fun getBusStopsSnapshot(): List<BusStopEntity>
A modern programming language that makes developers happier.