Zach Klippenstein (he/him) [MOD]
08/13/2020, 6:20 PMonPreCommit and onCommit are being merged! They were pretty confusing.Zach Klippenstein (he/him) [MOD]
08/13/2020, 6:20 PMAdam Powell
08/13/2020, 6:21 PMAdam Powell
08/13/2020, 6:22 PMAdam Powell
08/13/2020, 6:22 PMAdam Powell
08/13/2020, 6:24 PMvar state by remember { mutableStateOf<Thing>(value) }
onCommit(state) {
applySideEffect(state)
}
// elsewhere...
Modifier.event {
state = deriveFrom(it)
}Adam Powell
08/13/2020, 6:25 PMFlow or similar from some State that they already have but the alternative way to create that bridge is a lot more complicatedAdam Powell
08/13/2020, 6:27 PMval myFlow = flow {
observeSnapshotUpdates {
emit(deriveFrom(state1, state2))
}
}Adam Powell
08/13/2020, 6:29 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:30 PMobserveSnapshotUpdates would record reads of snapshot/state objects, and re-invoke the lambda when they’re changed?Adam Powell
08/13/2020, 6:30 PMsuspend fun that returns NothingAdam Powell
08/13/2020, 6:30 PMemit pattern aboveAdam Powell
08/13/2020, 6:31 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:31 PM@Composable function though, but basically a “special type” of function that would basically be have a subset of the behavior?Adam Powell
08/13/2020, 6:32 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:33 PM@Composable function is like a observeSnapshotUpdates function that also has an implicit Composer and can emit stuff” approaching the general idea?Adam Powell
08/13/2020, 6:33 PMAdam Powell
08/13/2020, 6:33 PMAdam Powell
08/13/2020, 6:34 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:34 PMAdam Powell
08/13/2020, 6:34 PMAdam Powell
08/13/2020, 6:34 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:36 PMobserveSnapshotUpdates is basically a collect{} of the snapshot “system”. Kind of like (pseudo-code) combineLatest(snapshotSystem[state1], snapshotSystem[state2]).collect { (state1, state2) -> … }Adam Powell
08/13/2020, 6:37 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:37 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:37 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:38 PMAdam Powell
08/13/2020, 6:39 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:42 PMAdam Powell
08/13/2020, 6:43 PMZach Klippenstein (he/him) [MOD]
08/13/2020, 6:45 PMAndrew Neal
08/13/2020, 7:51 PMshikasd
08/13/2020, 8:14 PMI'd draw it as your UI snapshot as a plane moving in time along a Z-axisTime travelling here :)