Overview of Decompose
masterDecompose is a Kotlin Multiplatform library designed to break down code into tree-structured, lifecycle-aware business logic components (BLoC). It provides routing functionality and supports pluggable UIs such as Jetpack/Multiplatform Compose, Android Views, SwiftUI, and Kotlin/React.
Key benefits include:
- Separation of Concerns: Clear boundaries between UI and non-UI code.
- Testability: Business logic can be tested with pure multiplatform unit tests.
- Navigation: Navigation state is fully exposed, allowing for custom animations and UI implementations. Navigation is treated as a pure function from old state to new state.
- Lifecycle Awareness: Components are lifecycle-aware and can continue working in the background even when their UI is not present.
- State Preservation: Supports automatic state preservation on Android and manual preservation on other targets via
kotlinx-serialization. - Dependency Injection: Supports proper DI and IoC via constructors.