-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
State production suspension and caching with Molecule #271
Comments
The
If you want to stop composition and restart it, that means managing the |
Gotcha, if I understand correctly:
I'll close the issue, thank you. |
There are two questions in this:
Coroutine
is active. In the case where there is no collector of the produced state, can there be a way to stop composing thePresenter
?Consider the
ProfilePresenter
example:The initial state is produced will always be
Loading
. In the case whereData
has been produced and theProfilePresenter
is no longer being composed because theStateFlow
is not being collected from, (maybe the owning screen has been placed in the back stack), I would like to prevent the last seenData
from immediately being overwritten byLoading
as I return to the screen and the presenter produces state yet again.i.e:
The above can be worked around by using
moleculeFlow
with theFlow
builder to allow seeding as theFlow
is cold, and then creating aStateFlow
with the rightSharingStarted
argument:Though I wonder if I'm missing something more obvious. If not, a built in API that allows for it would be really nice.
The text was updated successfully, but these errors were encountered: