aballano
11/01/2019, 6:35 PMLuca Nicoletti
11/01/2019, 7:13 PMval (value, setValue) = +state<T> { initialValue }
Fudge
11/01/2019, 7:25 PMFudge
11/01/2019, 7:25 PMby
Luca Nicoletti
11/01/2019, 7:25 PMLuca Nicoletti
11/01/2019, 7:26 PMFudge
11/01/2019, 7:27 PMLuca Nicoletti
11/01/2019, 7:27 PMFudge
11/01/2019, 7:27 PMFudge
11/01/2019, 7:28 PMmessages = messages + it
Fudge
11/01/2019, 7:28 PMLuca Nicoletti
11/01/2019, 7:28 PMLouis Pullen-Freilich [G]
11/01/2019, 7:29 PMvar checkedState by +state { true }
Switch(
checked = checkedState,
onCheckedChange = { checkedState = it }
)
With destructuring:
val (checked, onChecked) = +state { true }
Switch(
checked = checked,
onCheckedChange = onChecked
)
Although most of the time I would agree that delegate is the nicest way of consuming state.Fudge
11/01/2019, 7:29 PMLuca Nicoletti
11/01/2019, 7:30 PMby
is nicerLuca Nicoletti
11/01/2019, 7:30 PMLuca Nicoletti
11/01/2019, 7:31 PMFudge
11/01/2019, 7:31 PMLuca Nicoletti
11/01/2019, 7:32 PMFudge
11/01/2019, 7:32 PMFudge
11/01/2019, 7:33 PMLuca Nicoletti
11/01/2019, 7:34 PMaballano
11/01/2019, 7:35 PMaballano
11/01/2019, 7:36 PMaballano
11/01/2019, 7:36 PMFudge
11/01/2019, 7:36 PMLuca Nicoletti
11/01/2019, 7:37 PMLuca Nicoletti
11/01/2019, 7:37 PMFudge
11/01/2019, 7:38 PMLuca Nicoletti
11/01/2019, 7:38 PMLuca Nicoletti
11/01/2019, 7:38 PMthis is wrong just like putting semicolons when you don’t need them is wrong
Fudge
11/01/2019, 7:39 PMLuca Nicoletti
11/01/2019, 7:39 PMLuca Nicoletti
11/01/2019, 7:40 PMsuboptimal
instead of wrong
then fine, you’re completely right 😄alexsullivan114
11/01/2019, 8:03 PMLuca Nicoletti
11/01/2019, 8:05 PMthemishkun
11/02/2019, 6:47 AMRyan Mentley
11/04/2019, 9:15 PMsetMessages
instead of messagesChanges
?