
Shared MVVM library for UI applications with lifecycle-aware components, state restoration, and interoperability with Swift/Objective-C and SwiftUI. Supports multiple platforms, including Compose Multiplatform.
Common/ Shared ViewModel in Kotlin Multiplatform - A Kotlin Multiplatform library that provides shared MVVM for UI applications. Components are lifecycle-aware on Android. Supports Android Parcelable, Kotlin Parcelize, AndroidX SavedStateHandle for restoring state after process death. Easy interoperability with Swift/Objective-C and SwiftUI. Supports Compose Multiplatform Framework (Android, Desktop, Web, iOS, macOS, tvOS, watchOS).
The ViewModel class is a business logic or screen level state holder. It exposes state to the UI and encapsulates related business logic. Its principal advantage is that it caches state and persists it through configuration changes (on Android).
Liked some of my work? Buy me a coffee (or more likely a beer)
android.jvm (must add kotlinx-coroutines-swing/kotlinx-coroutines-javafx to your dependencies to
make sure Dispatchers.Main available).[!NOTE] If you are targeting
Desktopand:
- not using
JetBrains Compose Multiplatform, you should provide the dependencyorg.jetbrains.kotlinx:kotlinx-coroutines-swingororg.jetbrains.kotlinx:kotlinx-coroutines-javafx.- using
JetBrains Compose Multiplatform, you should provideorg.jetbrains.kotlinx:kotlinx-coroutines-swing.Because the
ViewModel.viewModelScopedepends onDispatchers.Mainprovided by that libraries on Desktop.
js (IR).wasmJs.Darwin targets:
iosArm64, iosX64, iosSimulatorArm64.watchosArm32, watchosArm64, watchosX64, watchosSimulatorArm64.tvosX64, tvosSimulatorArm64, tvosArm64.macosX64, macosArm64.For more information check out the docs.
For more information check out the docs.
For more information check out the docs.
For more information check out the docs.
For more information check out the docs.
For more information check out the docs.
For more information check out https://github.com/hoc081098/solivagant library.
For more information check out the docs.
ViewHolders, using Jetpack Compose for Android and SwiftUi for iOS.ViewModels and integrates with Navigation in Compose Multiplatform. It uses Koin for DI.ViewModels and integrates with Navigation in Compose Multiplatform. It uses Koject for DI.SaveStateHandle (since 0.2.0).Flow/StateFlow, to use the ViewModel easily on ios/macOS/tvOS/watchOS platforms
(since 0.3.0).Compose Multiplatform Framework (since 0.5.0).Koin integration with ViewModel and JetBrains Compose Multiplatform (since 0.6.2).MIT License
Copyright (c) 2023-2024 Petrus Nguyễn Thái Học
Common/ Shared ViewModel in Kotlin Multiplatform - A Kotlin Multiplatform library that provides shared MVVM for UI applications. Components are lifecycle-aware on Android. Supports Android Parcelable, Kotlin Parcelize, AndroidX SavedStateHandle for restoring state after process death. Easy interoperability with Swift/Objective-C and SwiftUI. Supports Compose Multiplatform Framework (Android, Desktop, Web, iOS, macOS, tvOS, watchOS).
The ViewModel class is a business logic or screen level state holder. It exposes state to the UI and encapsulates related business logic. Its principal advantage is that it caches state and persists it through configuration changes (on Android).
Liked some of my work? Buy me a coffee (or more likely a beer)
android.jvm (must add kotlinx-coroutines-swing/kotlinx-coroutines-javafx to your dependencies to
make sure Dispatchers.Main available).[!NOTE] If you are targeting
Desktopand:
- not using
JetBrains Compose Multiplatform, you should provide the dependencyorg.jetbrains.kotlinx:kotlinx-coroutines-swingororg.jetbrains.kotlinx:kotlinx-coroutines-javafx.- using
JetBrains Compose Multiplatform, you should provideorg.jetbrains.kotlinx:kotlinx-coroutines-swing.Because the
ViewModel.viewModelScopedepends onDispatchers.Mainprovided by that libraries on Desktop.
js (IR).wasmJs.Darwin targets:
iosArm64, iosX64, iosSimulatorArm64.watchosArm32, watchosArm64, watchosX64, watchosSimulatorArm64.tvosX64, tvosSimulatorArm64, tvosArm64.macosX64, macosArm64.For more information check out the docs.
For more information check out the docs.
For more information check out the docs.
For more information check out the docs.
For more information check out the docs.
For more information check out the docs.
For more information check out https://github.com/hoc081098/solivagant library.
For more information check out the docs.
ViewHolders, using Jetpack Compose for Android and SwiftUi for iOS.ViewModels and integrates with Navigation in Compose Multiplatform. It uses Koin for DI.ViewModels and integrates with Navigation in Compose Multiplatform. It uses Koject for DI.SaveStateHandle (since 0.2.0).Flow/StateFlow, to use the ViewModel easily on ios/macOS/tvOS/watchOS platforms
(since 0.3.0).Compose Multiplatform Framework (since 0.5.0).Koin integration with ViewModel and JetBrains Compose Multiplatform (since 0.6.2).MIT License
Copyright (c) 2023-2024 Petrus Nguyễn Thái Học