https://kotlinlang.org logo
#compose
Title
# compose
a

Asad Mukhtar

09/12/2022, 10:39 AM
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()