jvmMain.io.mths.swing.flow.binding.shorthand.JComponentBindings.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.SwingFlow
import io.mths.swing.flow.lifecycle.ParentLifecycle
import kotlinx.coroutines.CoroutineScope
import javax.swing.JComponent
context (SwingFlow, Type)
fun bind(
init: suspend CoroutineScope.() -> Unit
) {
[email protected](lifecycle = ParentLifecycle(), init)
}
infix fun Type.binds(
init: context (CoroutineScope) Type.() -> Unit
) = binds(lifecycle = ParentLifecycle(), init)