Documentation / dataflow-async / com.femastudios.dataflow.async.util / com.femastudios.dataflow.Field
Go to reference

Extensions for com.femastudios.dataflow.Field

asAttribute

Creates a new Attribute using this as the field that contains the data.

fun <T> Field<AttributeData<T>>.asAttribute(): Attribute<T>

asNotNullOrLoadingAttribute

Creates a new Attribute from this field with the following behavior:

fun <T : Any> Field<T?>.asNotNullOrLoadingAttribute(): Attribute<T>

asRecomputableAttribute

Creates a new Attribute using this as the field that contains the data.

fun <T> Field<AttributeData<T>>.asRecomputableAttribute(recomputeCallable: () -> Unit): RecomputableAttribute<T>

async

Creates a new Attribute whose status will always be Loaded with the value of this field.

fun <T> Field<T>.async(): Attribute<T>

debounced

Returns a field whose value is debounced by the given delay and maxDelay (in milliseconds)

fun <T> Field<T>.debounced(delay: Long, maxDelay: Long? = null): TimeShiftedField<T>
fun <T> Field<T>.debounced(delay: (debouncedValue: T, newValue: T) -> Long, maxDelay: Long? = null): TimeShiftedField<T>

delayed

Returns a field whose value is delayed by the given delay (in milliseconds)

fun <T> Field<T>.delayed(delay: Long): TimeShiftedField<T>
fun <T> Field<T>.delayed(delay: (T, T) -> Long): TimeShiftedField<T>