commonMain.com.huanshankeji.compose.runtime.DeferredComposableRunner.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of compose-multiplatform-html-unified-common
Show all versions of compose-multiplatform-html-unified-common
Common wrappers of components (including layouts) and modifiers for Compose UI (Android, desktop (JVM), iOS, and web (Kotlin/Wasm)) and Compose HTML
The newest version!
package com.huanshankeji.compose.runtime
import androidx.compose.runtime.Composable
class DeferredComposableRunner {
private var composables: MutableList<@Composable () -> Unit>? = null
fun addComposable(composable: @Composable () -> Unit) {
composables!!.add(composable)
}
/** Add the composable functions with the non-composable functions and then invoke them. */
@Composable
fun ComposableRun(content: () -> Unit) {
composables = mutableListOf()
content()
for (composable in composables!!)
composable()
composables = null
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy