avelicu

Results 8 comments of avelicu

Here is a sample app using these primitives: https://github.com/avelicu/ReactiveTest/blob/main/app/src/main/java/net/velicu/reactivetest/MainScreenStateProducer.kt Happy to work to add these into the existing sample apps as well.

> "Why does the value of my molecule suddenly change when my ViewModel reappears?" That's the good part about this change - the value of the molecule should not change...

Well, it's precisely to help you cut off the expensive background work, for example subscription to database updates, while your app is backgrounded (but the data might still change as...

In other words, the .collectAsStateWhileMoleculeActive allows us to bridge the always active composition to stateflows that care about whether or not somebody is subscribed to them, and the awaitMoleculeActive /...

> And keeping composition going will also not do some of the stuff you might not want to do while your ViewModel is paused: e.g. shut down any background work....

Right now the state is actually always consumed within coroutines started within the molecule, not within the Composable bits of the molecule, so in that sense a stateflow in a...

> I think a State based API would support those uses as well, but in a more Compose-native way. They could also be used in coroutines via snapshotFlow. And the...

Hey friends, I came across this library recently and I'm very excited to try it in my app but I consider this issue a blocker. I have an alternative proposal...