whenever

inline fun <T> StyleClass.whenever(value: Flow<T>, crossinline predicate: suspend (T) -> Boolean): Flow<StyleClass>

applies a given css class only when a condition is fulfilled.

Receiver

css class to apply

Return

Flow containing the class name if check returns true or nothing

Parameters

value

Flow that holds the value to check

predicate

defining the rule, when to apply the class


fun StyleClass.whenever(condition: Flow<Boolean>): Flow<StyleClass>

applies a given css class only when a condition is fulfilled.

Receiver

css class to apply

Return

Flow containing the class name if check returns true or null

Parameters

condition

Flow that holds the value to check