Signal

interface Signal<out T>(source)

Represents a value that can be observed changing over time.

This interface defines the read-only aspect of a signal, but a writable interface exists through MutableSignal.

Since

0.1.0

Parameters

T

the type of the value

See also

Inheritors

Properties

Link copied to clipboard
abstract val value: T

The current value of the signal.

Functions

Link copied to clipboard
abstract operator fun <R> invoke(mapper: (T) -> R): Signal<R>

Maps this signal with the given mapping function.

Link copied to clipboard
abstract fun subscribe(subscriber: (T) -> Unit): Subscription

Creates a new subscription, emitting values by calling the subscriber when updates are received.