commonMain.com.arkivanov.decompose.extensions.compose.experimental.stack.Utils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of extensions-compose-experimental-jvm Show documentation
Show all versions of extensions-compose-experimental-jvm Show documentation
Kotlin Multiplatform lifecycle-aware business logic components
package com.arkivanov.decompose.extensions.compose.experimental.stack
import com.arkivanov.decompose.router.stack.ChildStack
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.joinAll
import kotlinx.coroutines.launch
internal fun ChildStack.dropLast(): ChildStack =
ChildStack(active = backStack.last(), backStack = backStack.dropLast(1))
internal val ChildStack<*, *>.size: Int get() = items.size
internal suspend inline fun awaitAll(vararg jobs: suspend CoroutineScope.() -> Unit) {
coroutineScope {
jobs.map { launch(block = it) }.joinAll()
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy