ReadWritePropertyDefaultSubject
constructor(defaultValue: R, readWriteProperty: ReadWriteProperty<Any?, T?>, initialValue: ObservableOptional.Value<T?> = Value(
run {
val v by readWriteProperty
v
},
), coroutineScope: CoroutineScope?, context: CoroutineContext? = coroutineScope?.coroutineContext, observation: ObservationDefault<R, T?> = ObservationDefault(defaultValue, initialValue))
Parameters
T
the type of value to expect.
R
the type of result to expect. Must be a subclass of T
defaultValue
The default R to return if the value of the ReadWriteProperty is null
.
readWriteProperty
The ReadWriteProperty to track.
initialValue
The initial value of T. Defaults to the current value of the ReadWriteProperty.
coroutineScope
The CoroutineScope on which to emit changes to the ReadWriteProperty
context
The CoroutineContext in which to emit changes to the ReadWriteProperty
observation
The ObservationInitialized to handle observation.