Hi, I recently discovered Square's Workflow librar...
# multiplatform
c
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?
k
I'd recommend implementing presenters/view models with compose state management instead. https://github.com/cashapp/molecule/
1
c
I'll take a look at it, thanks 👍
👍 1
c
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
r
Workflow does have multiplatform support in the core and runtime modules.
c
@kevin.cianfarini I took a look at your suggestion and it made me write this article, thanks again 👍 https://medium.com/@cgaisl/beyond-mvvm-hierarchical-state-management-with-molecule-and-compose-660648eeb88e