Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
renetik committed Jun 20, 2024
1 parent c6e2b1a commit da7b4c5
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ fun <T> CSHasChangeValue<T?>.actionNotNull(function: (T) -> Unit) =

operator fun CSHasChangeValue<Boolean>.not() = delegate(from = { !it })

operator fun CSHasChangeValue<Boolean>.plus(other: CSHasChangeValue<Boolean>) =
(this to other).delegate(from = { first, second -> first && second })

inline fun <Value> CSHasChangeValue<Value>.onChangeTo(
value: Value, crossinline onChange: () -> Unit
): CSRegistration = onChange { if (this.value == value) onChange() }
Expand Down

0 comments on commit da7b4c5

Please sign in to comment.