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.

Return

Flow containing the class name if check returns true or nothing

Parameters

<receiver>

css class to apply

predicate

defining the rule, when to apply the class

value

Flow that holds the value to check

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

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

Return

Flow containing the class name if check returns true or null

Parameters

<receiver>

css class to apply

condition

Flow that holds the value to check