Package-level declarations

Types

Link copied to clipboard
abstract class Component<TConfig : Any>(configCreator: ConfigCreator<TConfig>? = null)

This class defines a very simple UI component abstraction. Every Component is supposed to be rendered inside other Components forming a tree where the head is Component.Root.

Link copied to clipboard
typealias ConfigCreator<TConfig> = () -> TConfig
Link copied to clipboard
interface Effect

Effect of rendering a Component.

Link copied to clipboard
class LazyEffect(val state: LazyEffectState) : Effect
Link copied to clipboard
typealias LazyEffectState = ObservableState<Boolean>
Link copied to clipboard
typealias MutableLazyEffectState = ObservableValue<Boolean>
Link copied to clipboard
data class SimpleEffect(val success: Boolean) : Effect

Functions

Link copied to clipboard
suspend fun SimplePanel.launch(component: Component<*>): Job

Launches component's render on this SimplePanel.

suspend fun <TConfig : Any> SimplePanel.launch(component: Component<TConfig>, config: TConfig.() -> Unit)

Applies config to component and launches render on this SimplePanel.

Link copied to clipboard
fun SimplePanel.render(component: Component<*>): Effect

Synchronously renders component on this SimplePanel and returns effect.

fun <TConfig : Any> SimplePanel.render(component: Component<TConfig>, config: TConfig.() -> Unit): Effect

Applies config to component, synchronously renders it on this SimplePanel and returns effect.