Updated on 2026-08-14

This commit is contained in:
Tangem 2026-01-06 13:44:56 +03:00
parent 680794d447
commit a61004a3c1
18 changed files with 459 additions and 106 deletions

View file

@ -0,0 +1,18 @@
package com.tangem.core.decompose.utils
import com.arkivanov.decompose.router.stack.StackNavigation
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlin.coroutines.resume
/**
* Retrieves the current stack of items from the [com.arkivanov.decompose.router.stack.ChildStack]
* @return A list representing the current stack of items
*/
suspend fun <T : Any> StackNavigation<T>.stack(): List<T> {
return suspendCancellableCoroutine { continuation ->
this.navigate(
transformer = { stack -> stack },
onComplete = { newStack, oldStack -> continuation.resume(newStack) },
)
}
}