Nat Strangerweather
01/08/2021, 10:23 PM.observeAsState
. In my ViewModel I have this:
val dynamicCallSenderCode = MutableLiveData(0)
fun onSenderChanged (){
dynamicCallSenderCode.value = broadcastReceivers.notifyCallSenderCode(context)
}
What I want to do is observe the broadcast receiver changes from my HomePage but I can't use .observeAsState
with a function. How could I pass these changes live to my Composable?Ian Lake
01/08/2021, 11:11 PMval senderCode = viewModel.dynamicCallSenderCode.observeAsState().value
and that would recompose anytime the value changes