Comments (4)
Using molecule also gives you the power to scope that work to whatever class you're going to be holding it in. For example, as the PR here #274 shows, you can scope your molecule presenter to your AAC ViewModel, meaning that if the UI for whatever reason gets destroyed, like in a config change situation, your molecule presenter would persist for until the new UI comes on the screen after the config change.
So don't think it's as simple as, you're using compose UI -> No need for molecule.
from molecule.
If you have a full compose UI app, most of the config changes are already handled
The key word here is "most", not all of them. So still relevant.
from molecule.
To the question : Are there any cons to using molecule in this scenario?
I found using rememberSaveable
wasn't working when the instance holding the moleculeScope is destroyed/recreated.
But maybe I did something wrong with my config.
from molecule.
Using molecule also gives you the power to scope that work to whatever class you're going to be holding it in. For example, as the PR here #274 shows, you can scope your molecule presenter to your AAC ViewModel, meaning that if the UI for whatever reason gets destroyed, like in a config change situation, your molecule presenter would persist for until the new UI comes on the screen after the config change.
So don't think it's as simple as, you're using compose UI -> No need for molecule.
If you have a full compose UI app, most of the config changes are already handled at the Compose level, so you can avoid destroying the activity. Plus this is more the responsability of the data/domain layer to handle this properly instead of AAC ViewModel...
from molecule.
Related Issues (20)
- Send real time in frame clocks, and test it HOT 1
- Kotlin 1.8.21 release
- Changing a MutableState inside a coroutine seemingly leads to skipped emissions HOT 4
- Kotlin 1.9-compatible release
- How to access `LocalContext` or `stringResources` in a Presenter? HOT 5
- State production suspension and caching with Molecule HOT 2
- JS frame time can produce the same value
- sample-viewmodel module showcases keeping an always hot StateFlow in the ViewModel HOT 2
- Feature request: publish plugin to gradle plugin portal
- README is still referring to RecompositionClock HOT 2
- Provide the ability to set the JB Compose compiler version in our plugin
- Migrate to Gradle Kotlin DSL HOT 4
- Test fails while trying to use a ViewModel-like object with Turbine HOT 1
- Caused by: java.lang.UnsatisfiedLinkError: 'long android.os.Trace.nativeGetEnabledTags()' HOT 2
- Compose stops recomposing in tests HOT 7
- More samples HOT 4
- Debouncing state emissions HOT 4
- NodeJS frame clock for JS
- WASM tracking issue HOT 5
- Make launchMolecule return a Job? HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from molecule.