All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.com.arkivanov.decompose.extensions.compose.experimental.stack.Utils.kt Maven / Gradle / Ivy

There is a newer version: 3.3.0-alpha02
Show newest version
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