Hi, how i use the api response from viewModel to Composable function?
Like i have a this code, how i observe the flightsList and show the data in Composable function?
Copy code
private val _flightList = MutableLiveData<List<FlightListingUiModel>>()
val flightsList: LiveData<List<FlightListingUiModel>> = _flightList
m
mgrazianodecastro
09/12/2022, 6:18 PM
try, inside the compose:
Copy code
val flihtList by viewModel.flightList.observeAsState()