pale-blue-cmp-core
1.0.0indexedType-safe suspendable navigation with result-passing (primitives and serializable objects), plus a lightweight MVI ViewModel interface to standardize UI state management.
0
Stars
—
Used by
dependents
—
Health
/ 100
Type-safe suspendable navigation with result-passing (primitives and serializable objects), plus a lightweight MVI ViewModel interface to standardize UI state management.
A Kotlin Multiplatform (KMP) library for common androidx extensions, including Navigation and MVI utilities.
NavController. Supports primitives and serializable objects.MviViewModel interface to standardize state management in Compose Multiplatform or Android apps.Add the library dependency to your build.gradle.kts file.
dependencies {
implementation("com.paleblueapps:cmpcore:[latest-version]")
}
This extension allows you to navigate to a screen and wait for a result asynchronously.
// Screen A: Navigate and wait for result
val result: String? = navController.navigateForResult("NextScreen")
// Screen B: Navigate back with result
navController.navigateBackWithResult("Success")
@Serializable
data class User(val id: String, val name: String)
// Screen A: Navigate and wait for serializable result
val user: User? = navController.navigateForSerializableResult<User>("UserSelectionScreen")
// Screen B: Navigate back with serializable result
navController.navigateBackWithSerializableResult(User("1", "John Doe"))
Standardize your ViewModels using the MviViewModel interface.
data class ( isLoading: = )
{ Refresh : MyAction() }
: (), MviViewModel<MyState, MyAction> {
_state = MutableStateFlow(MyState())
state: StateFlow<MyState> = _state.asStateFlow()
{
(action) {
MyAction.Refresh -> { }
}
}
}
Surfaced from shared tags and platforms — no rankings paid for.