elizarov
05/12/2019, 7:37 PMstate
(apart from +
operator):
var foo by +state { 0 } // property delegation to state
var (foo, setFoo) = +state { 0 } // destructuring state
Is the second-one just a React/JS gimmick because “we can” or is it really useful in some use-cases?Robert Menke
05/12/2019, 9:58 PMsetFoo
in cases where you might want to use techniques like currying or function composition. How do you define setFoo
with the +state
api?jim
05/13/2019, 5:57 PMvar
by capturing inside a child composable.