Erik
10/29/2022, 9:17 PMcopy
the state and pass it to the callback. I've now refactored the callback to not take a state S
, but take a S.() -> S
lambda instead. This leads to lambdas in lambdas everywhere. While it's not a big issue (and Kotlin's last-lambda-argument passing helps a lot here), I wonder:
Is there a different idiomatic Kotlin+compose way to handle this situation? And how would you name the callback? First I had something like onNewState: (S) -> Unit
, but now it's more verbose: onNewStateTransform: S.() -> S
. Any better name suggestions?Zach Klippenstein (he/him) [MOD]
10/31/2022, 3:55 PMErik
11/07/2022, 2:29 PM