Paul Woitaschek
10/06/2021, 9:55 AMvar a: Boolean by remember { mutableStateOf(false) }
var b: Boolean = remember { false }
myanmarking
10/06/2021, 9:56 AMmyanmarking
10/06/2021, 9:57 AMmyanmarking
10/06/2021, 9:59 AMmyanmarking
10/06/2021, 10:00 AMPaul Woitaschek
10/06/2021, 10:02 AMTgo1014
10/06/2021, 10:02 AMmyanmarking
10/06/2021, 10:03 AMFilip Wiesner
10/06/2021, 10:03 AMvar
it is different. First will recompose on change and second does nothing. And by nothing I mean it's pointless. You could just write var b = false
hfhbd
10/06/2021, 11:49 AMState
changes. remember
keeps the changed states
between recomposing, otherwise the State
would be the init state after recomposing.Paul Woitaschek
10/06/2021, 12:25 PMZach Klippenstein (he/him) [MOD]
10/06/2021, 3:23 PMremember
is just asking the composition what value its lambda returned the first time it was composed.Paul Woitaschek
10/06/2021, 3:25 PMZach Klippenstein (he/him) [MOD]
10/06/2021, 3:29 PMAdam Powell
10/07/2021, 1:19 PM