kite-core / jp.co.cyberagent.kite.core / AbstractKiteMutableState
AbstractKiteMutableState¶
abstract class AbstractKiteMutableState<T> :
KiteMutableState
<
T
>
Inherits this abstract class to create custom KiteMutableState. When KiteMutableState.value changed, calls notifyChanged to notify its subscriber. When access the getter of KiteMutableState.value, calls subscribe to add itself as the dependency to any potential subscriber.
Constructors¶
Name | Summary |
---|---|
<init> | AbstractKiteMutableState() Inherits this abstract class to create custom KiteMutableState. When KiteMutableState.value changed, calls notifyChanged to notify its subscriber. When access the getter of KiteMutableState.value, calls subscribe to add itself as the dependency to any potential subscriber. |
Inherited Properties¶
Name | Summary |
---|---|
value | abstract var value: T |
Functions¶
Name | Summary |
---|---|
notifyChanged | fun notifyChanged(): Unit |
subscribe | fun subscribe(): Unit |
Extension Functions¶
Name | Summary |
---|---|
asKiteContextElement | fun <T : Any > T .asKiteContextElement(): Pair < KClass <*>, Any > Creates a KiteContextElement with the KClass |
getValue | operator fun <T> KiteState < T >.getValue(thisRef: Nothing ?, prop: KProperty <*>): T Supports delegated property. |
setValue | operator fun <T> KiteMutableState < T >.setValue(thisRef: Nothing ?, prop: KProperty <*>, value: T ): Unit Supports delegated property. |
update | fun <T> KiteMutableState < T >.update(f: (curr: T ) -> T ): Unit Updates the value with the result of function f has one parameter that receives current value. |