I’ve been looking at Molecule for use with Compose. It’s intriguing the idea that’s being proposed. Effectively, it seems like it boils down to Presenter as a function.
What are the benefits that this enables me to take advantage of that I didn’t have access to before? I’m curious as to peoples thoughts, and am looking for opinionated answers.
z
Zach Klippenstein (he/him) [MOD]
12/04/2021, 5:31 AM
I think this is very similar in spirit to the Square Workflow library, but much more elegant and flexible, with less boilerplate. So all the advantages of that, and more.
👀 1
c
CLOVIS
12/04/2021, 8:17 AM
I'm curious of what the goal is, compared to normal Flow functions.
Previously, we had:
• functions that return Flows, which generate the data
• composables that display UI from those Flows
With Molecule, my understanding is that we get:
• composables that return Flows, which generate the data
• composables that display UI from those Flows
I don't really get the appeal of what it helps with, since it has a bit more boilerplate than normal Flows
a
Albert Chang
12/04/2021, 11:49 AM
I don't think Molecule is intended to be used with Compose UI. If you are using Compose UI, you can already use composable functions and snapshot states without the need of Molecule.
But no example of using Molecule with Compose UI. I can't think of any advantages of that. You can always separate UI logic and business logic in Compose UI without using Molecule.