v79
12/12/2020, 9:00 AMval count = remember { mutableStateOf(0) }
I mean, what does that even mean? What's wrong with var count = 0
or val count: IntWrapper = IntWrapper(0)
. remember
isn't listed as in import, control-clicking doesn't take me to a declaration. It's wilfully obtuse!Archie
12/12/2020, 10:05 AMArchie
12/12/2020, 10:06 AMArchie
12/12/2020, 10:07 AMv79
12/12/2020, 1:12 PMMutableState<Int> count = StateManager.add<Int>(0)
or something like that (I just invented it) would be more explicit to me. I've been trying to persuade a C++ developer friend of mine to look at Kotlin and this sort of stuff is putting him off.
It's a pity that the by remember
delegate suggested in the documentation doesn't work for Desktop.v79
12/12/2020, 1:28 PMArchie
12/12/2020, 1:34 PMZach Klippenstein (he/him) [MOD]
12/12/2020, 8:25 PMval count: MutableState<Int> = remember<MutableState<Int>> { mutableStateOf<Int>(0) }
Although after seeing this pattern a couple of times you probably only need one of those.Colton Idle
12/13/2020, 4:53 PMZach Klippenstein (he/him) [MOD]
12/13/2020, 5:57 PMv79
12/14/2020, 10:31 AMZach Klippenstein (he/him) [MOD]
12/14/2020, 4:18 PM