Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
renetik committed Aug 4, 2024
1 parent 309d755 commit f24d04a
Showing 1 changed file with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,22 @@ interface CSHasChangeValue<T> : CSValue<T>, CSHasChange<T> {
crossinline onChange: () -> Unit,
): CSRegistration = onChange(first, second, third) { _, _, _ -> onChange() }

inline fun <Argument1, Argument2, Argument3>
Triple<CSHasChangeValue<Argument1>,
CSHasChangeValue<Argument2>,
CSHasChangeValue<Argument3>>.onChangeLaterOnce(
crossinline onChange: (Argument1, Argument2, Argument3) -> Unit,
): CSRegistration = list(first, second, third)
.onChangeLaterOnce { onChange(first.value, second.value, third.value) }

inline fun <Argument1, Argument2, Argument3>
Triple<CSHasChangeValue<Argument1>,
CSHasChangeValue<Argument2>,
CSHasChangeValue<Argument3>>.onChangeLaterOnce(
crossinline onChange: () -> Unit,
): CSRegistration = list(first, second, third)
.onChangeLaterOnce { onChange() }

inline fun <Argument1, Argument2, Argument3> action(
item1: CSHasChangeValue<Argument1>,
item2: CSHasChangeValue<Argument2>,
Expand All @@ -382,6 +398,21 @@ interface CSHasChangeValue<T> : CSValue<T>, CSHasChange<T> {
crossinline onAction: (Argument1, Argument2, Argument3) -> Unit,
): CSRegistration = action(first, second, third, onAction)

inline fun <Argument1, Argument2, Argument3>
Triple<CSHasChangeValue<Argument1>,
CSHasChangeValue<Argument2>,
CSHasChangeValue<Argument3>>.actionLaterOnce(
crossinline onAction: (Argument1, Argument2, Argument3) -> Unit,
): CSRegistration = list(first, second, third)
.actionLaterOnce { onAction(first.value, second.value, third.value) }

inline fun <Argument1, Argument2, Argument3>
Triple<CSHasChangeValue<Argument1>,
CSHasChangeValue<Argument2>,
CSHasChangeValue<Argument3>>.actionLaterOnce(
crossinline onAction: () -> Unit,
): CSRegistration = actionLaterOnce { a, b, c -> onAction() }

inline fun <Argument1, Argument2, Argument3, Argument4> onChange(
item1: CSHasChangeValue<Argument1>,
item2: CSHasChangeValue<Argument2>,
Expand Down

0 comments on commit f24d04a

Please sign in to comment.