Skip to content

Instantly share code, notes, and snippets.

View Elblassy's full-sized avatar
🏠
Working from home

Muhammad Elblasy Elblassy

🏠
Working from home
View GitHub Profile
@arkivanov
arkivanov / Navigator.kt
Last active August 4, 2023 12:29
Compose-like navigation with Decompose
@Composable
fun <T : Parcelable> Navigator(
initialConfiguration: () -> T,
configurationClass: KClass<out T>,
content: @Composable Router<T>.(T) -> Unit
) {
val lifecycle = getLifecycle()
val stateKeeper = getStateKeeper()
val context = remember { DefaultComponentContext(lifecycle = lifecycle, stateKeeper = stateKeeper) }