Arjan van Wieringen
04/29/2022, 9:52 AMAdam Powell
04/29/2022, 1:52 PMArjan van Wieringen
04/29/2022, 2:39 PMAdam Powell
04/29/2022, 2:43 PMArjan van Wieringen
04/29/2022, 5:13 PMAdam Powell
04/29/2022, 5:37 PM@Composable
functions that emit the node type for that applier; these will be the composables you build everything else out ofComposition
using an instance of your applier plus a CompositionContext
CompositionContext
can be obtained from rememberCompositionContext()
to create a subcomposition of an existing composition, or you can construct your own Recomposer
to drive compositions yourselfRecomposer
is a CompositionContext
)Arjan van Wieringen
04/29/2022, 5:41 PMAdam Powell
04/29/2022, 5:43 PMRecomposer.runRecomposeAndApplyChanges
is the main loop of recomposition, it listens for invalidations to the compositions registered with it and then awaits a frame from the calling `CoroutineContext`'s MonotonicFrameClock
- you can see BroadcastMonotonicFrameClock
for an example/one you can use in some situations. It will give you a callback once something wants a frame from it and then you can choose when to signal the frame to perform recomposition. Usually you'll want to do this right before you intend to do something with the recomposed output tree, when you want to get your applier to apply all potential changeswithRunningRecomposer
api that makes the setup of the runRecomposeAndApplyChanges
part a bit more turnkeyArjan van Wieringen
04/29/2022, 7:21 PMAdam Powell
04/29/2022, 7:33 PMSnapshot.withMutableSnapshot { doStuff() }
Chris Arriola
05/03/2022, 8:40 PMArjan van Wieringen
05/04/2022, 6:28 AMIcyrockton
05/05/2022, 3:53 PM