AttributeHook

class AttributeHook<C : Tag<*>, T>(valueSetter: C.(T) -> Unit, flowOfValueSetter: C.(Flow<T>) -> Unit) : Hook<C, Unit, Unit>

This Hook encapsulates the effect of setting an attribute to a Tag.

The attribute itself has to be defined by the owner of the hook as constructor parameter, the specific value however can be provided by the user.

If the user does not provide any value, no attribute will be attached to the Tag!

Constructors

Link copied to clipboard
constructor(valueSetter: C.(T) -> Unit, flowOfValueSetter: C.(Flow<T>) -> Unit)

Properties

Link copied to clipboard
var alsoExpr: Unit.() -> Unit?

This field encapsulates some behaviour, which should be applied to the result R of the Hook's Effect.

Link copied to clipboard
Link copied to clipboard
open var value: Effect<C, Unit, Unit>?

Functions

Link copied to clipboard
fun also(expr: Unit.() -> Unit)

This method offers the created result as receiver within a context expression in order to expose some additional configuration entry point for a client.

Link copied to clipboard
operator fun invoke(value: T?)
operator fun invoke(value: Flow<T>)
Link copied to clipboard
fun use(item: Effect<C, Unit, Unit>)