Skip to content

Are there cases where it’s better to consume a value as compose.runtime.State? #1865

Answered by ZacSweers
shaharKeisarApps asked this question in Q&A
Discussion options

You must be logged in to vote

Circuit state only has to be Stable, you can use stable properties in circuit state classes if you want. That said, the same standard compose design guidelines kick in here. Use callbacks, avoid passing state directly, etc. If you've measured this and found a meaningful performance issue, you could explore writing your state as an interface backed by state objects for this specific use case. But again - *if you've measured this.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@shaharKeisarApps
Comment options

@shaharKeisarApps
Comment options

@ZacSweers
Comment options

Answer selected by shaharKeisarApps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants