This message was deleted.
# compose
s
This message was deleted.
c
No to both questions. By default a
Unit
returning
@Compsoable
is but you can make a function non-restartable explicitly with an
@NonRestartableCompposable
annotation. This is useful for wrappers that don't themselves, read state.
Yes. You may want to call out that non-inline composable lambdas have their own recompose scope which might not be obvious given that description.
🙏 1
The above is mostly correct but not how I would phrase it. Some details that could be improved are, 1. The Kotlin compiler also produces errors and warnings which is part of the front-end. 2. The
Composer
is also an input parameter as that is where `CompositionLocal`s come in, for example. 3. Composable lambdas are also recompose scopes. It is technically captured by "all functions" but most people don't think of lambdas that way so I always call it out explicitly. 4. The
Composition
holds the state of the composition. It is not written to directly but contains the slot table which is. What you wrote is not technically incorrect but I would have phrased this differently. 5. Composition observes reads in recompose scopes and changes to the values read regardless of where the change occurs. While composition observes writes in composition, this is a part of observing changes in general.
This is mostly correct. I might quibble with how things are described but that is more a style choice than a correctness issue. The essence is correct,
@Compsoable
functions are transforms function that transform the data to a tree and listen for changes in that data to make corresponding changes to the tree. For Compose UI, that tree is LayoutNodes.