diff --git a/library/src/main/java/renetik/android/event/registration/CSHasChangeValue+.kt b/library/src/main/java/renetik/android/event/registration/CSHasChangeValue+.kt index cde5976..1d1fa4b 100644 --- a/library/src/main/java/renetik/android/event/registration/CSHasChangeValue+.kt +++ b/library/src/main/java/renetik/android/event/registration/CSHasChangeValue+.kt @@ -108,6 +108,9 @@ fun CSHasChangeValue.actionNotNull(function: (T) -> Unit) = operator fun CSHasChangeValue.not() = delegate(from = { !it }) +operator fun CSHasChangeValue.plus(other: CSHasChangeValue) = + (this to other).delegate(from = { first, second -> first && second }) + inline fun CSHasChangeValue.onChangeTo( value: Value, crossinline onChange: () -> Unit ): CSRegistration = onChange { if (this.value == value) onChange() }