Petru
03/20/2024, 4:56 PMmolecule
since I see the @Composable Presenter pattern being used more and more
So there must be a reason / advantage but I'm not seeing it.
I understand that it normally helps with synchronizing the evaluation of events/actions and emitting a new state
With the device framerate.
But why is this needed versus just observing a flow of events/actions and updating an observable state
(Basically everything shown as advantages in the documentation, just without @Composable - the need of which is not explained)Petru
03/20/2024, 4:58 PMjw
03/20/2024, 4:58 PMjw
03/20/2024, 4:58 PMjw
03/20/2024, 5:03 PMUnfortunately, we are mixing business logic with display logic which makes testing harder than if it were separated. The display layer is also interacting directly with the storage layer which creates undesirable coupling. Additionally, if we want to power a different display with the same logic (potentially on another platform) we cannot.
jw
03/20/2024, 5:03 PMPetru
03/20/2024, 5:05 PMjw
03/20/2024, 5:14 PMjw
03/20/2024, 5:15 PMjw
03/20/2024, 5:15 PMjw
03/20/2024, 5:20 PMPetru
03/20/2024, 5:40 PM@Composable Presenter
without saying that you don't need it on Android and then (because of this?) this pattern gets presented in tutorials targeted to Android
(like https://medium.com/@ruby.lich/molecule-build-powerful-stateflows-with-jetpack-compose-fe0e40c2c740 or https://apiumhub.com/tech-blog-barcelona/from-viewmodel-to-compose/)Petru
03/20/2024, 5:42 PMjw
03/20/2024, 5:44 PMArjan van Wieringen
03/20/2024, 8:21 PMjw
03/20/2024, 9:10 PMjw
03/20/2024, 9:11 PMArjan van Wieringen
03/21/2024, 5:42 AM