Presenter state stored as class properties vs inside present() — is this an intended pattern? #2546
Unanswered
AnandaDwiprayoga
asked this question in
Q&A
Replies: 1 comment
-
|
That's valid. As far as patterns go it's beholden to any other compose idioms when dealing with class instances (i.e. entire your presenter class abides by the stable contract with its data) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In our app, we are using a Presenter class and keeping screen-related state as class properties, while present() simply collects and exposes that state to Compose.
A simplified example looks like this:
Question
While this pattern feels natural and aligns with how Presenters behave lifecycle-wise, I couldn’t find a clear example in the official docs that explicitly shows:
keeping MutableStateFlow (or other state holders) as Presenter properties and only collecting them inside present()
So I wanted to ask:
Beta Was this translation helpful? Give feedback.
All reactions