jvmMain.io.mths.swing.flow.binding.shorthand.CommonBindings.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swing-flow Show documentation
Show all versions of swing-flow Show documentation
Kotlin Flow integration for Swing.
The newest version!
package io.mths.swing.flow.binding.shorthand
import io.mths.swing.flow.lifecycle.Lifecycle
import io.mths.swing.flow.swingFlow
import kotlinx.coroutines.CoroutineScope
fun Type.binds(
lifecycle: Lifecycle,
init: context (CoroutineScope) Type.() -> Unit
): Type =
swingFlow(this) {
bind(lifecycle) {
init(this@bind, this@binds)
}
}