CSEventPropertyBase

abstract class CSEventPropertyBase<T>(parent: CSHasDestroy? = null, val onChange: (value: T) -> Unit? = null) : CSEventOwnerHasDestroyBase, CSEventProperty<T>

Constructors

Link copied to clipboard
fun <T> CSEventPropertyBase(onApply: (value: T) -> Unit? = null)
Link copied to clipboard
fun <T> CSEventPropertyBase(parent: CSHasDestroy? = null, onChange: (value: T) -> Unit? = null)

Functions

Link copied to clipboard
open override fun invokeChange()

Invoke change event with current value

Link copied to clipboard
open fun later(function: () -> Unit): CSRegistration

open fun later(delayMilliseconds: Int, function: () -> Unit): CSRegistration

later should be here instead of extension so Any.later is not called by mistake There is strange issue where postOnMain invokes immediately for unknown reason, so this was rewritten to not fail, even 5ms caused issue on some device so..

Link copied to clipboard
open override fun onChange(function: (T) -> Unit): CSRegistration
Link copied to clipboard
open override fun onDestroy()
Link copied to clipboard
open fun <T : Any> T.onMain(function: T.() -> Unit): CSRegistration?

onMain uses later(5) due to one strange rare multithreading issue where later function where executed earlier then later returned registration

Link copied to clipboard
open fun onValueChanged(newValue: T, fire: Boolean = true)
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
abstract fun value(newValue: T, fire: Boolean = true)

Properties

Link copied to clipboard
val associated: CSAssociation
Link copied to clipboard
val eventChange: CSEvent<T>
Link copied to clipboard
open override val eventDestroy: CSEvent<Unit>
Link copied to clipboard
val onChange: (value: T) -> Unit? = null
Link copied to clipboard
override val registrations: CSRegistrations
Link copied to clipboard
abstract override var value: T

Inheritors

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard