StateHolder

interface StateHolder

Classes that aim to provide a Stateful that platforms can observe should implement this interface to allow easy binding using auto-generated files for iOS. Implementing StateHolder also provides a DSL for creating various Stateful values, for example with stateful function.

Recommended way to implement StateHolder interface is to us delegation pattern.

class ExampleClassWithState : StateHolder by StateHolder()

See also

Properties

Link copied to clipboard
abstract val binder: Binder

Extensions

Link copied to clipboard
actual fun <T : Any> StateHolder.stateful(initialValue: T): Stateful<T>

Creates a Stateful

expect fun <T : Any> StateHolder.stateful(initialValue: T): Stateful<T>

Returns Stateful of type T

actual fun <T : Any> StateHolder.stateful(initialValue: T): Stateful<T>

Creates Stateful with provided initial value and callback set to one defined in StateHolder's Binder object.

actual fun <T : Any> StateHolder.stateful(initialValue: T): Stateful<T>