Kevin Hester
02/09/2020, 2:30 PMMark Murphy
02/09/2020, 2:34 PMAdam Powell
02/09/2020, 2:35 PM@Model
property or MutableState<T>
outside of composition, you're already good to go and compose can see it. For example, if you did nothing more than declare that isConnected
as var isConnected by mutableStateOf(false)
you're already set.Adam Powell
02/09/2020, 2:35 PMAdam Powell
02/09/2020, 2:37 PMmutableStateOf()
that can be called outside of compositionKevin Hester
02/09/2020, 2:47 PMAdam Powell
02/09/2020, 3:12 PMisConnected
state doesn't have to be read directly by compose for compose to see the change. If anything in the call stack accesses it during composition, compose will record the dependency on it. It can be a private property several objects away.Kevin Hester
02/09/2020, 6:28 PM