Hi, I recently discovered Square's Workflow library. It's an evolution of the ViewModel concept that implements an action pipeline that keeps the state sane when processing multiple actions concurrently. Also, it adds props/inputs and outputs to workflows/ViewModels, making it possible to hoist state to a parent ViewModel. This makes workflows reusable, similar to how hoisting state out of Compoes Views makes them reusable. With that we can use workflows hierarchically in a parent-child hierarchy, making complex inter-screen interactions, like split screens or multi-screen sign-up flows possible. The library is built independent of the UI framework used, making it a prime candidate to write in a shared Kotlin Multiplatform module. Is there something like Workflow for Kotlin Multiplatform?
Ballast gives a more traditional MVI approach that may be more familiar than Molecule if you're comfortable with Workflow. It also has additional features like Navigation and an Intellij plugin to help with debugging your ViewModels (disclaimer, I'm the author) https://github.com/copper-leaf/ballast
10/22/2023, 4:22 PM
Workflow does have multiplatform support in the core and runtime modules.