diff --git a/colibri/src/main/scala/colibri/Observable.scala b/colibri/src/main/scala/colibri/Observable.scala index cdffb503..5f7aae6c 100644 --- a/colibri/src/main/scala/colibri/Observable.scala +++ b/colibri/src/main/scala/colibri/Observable.scala @@ -1680,14 +1680,14 @@ object Observable { } @inline implicit class BooleanOperations(private val source: Observable[Boolean]) extends AnyVal { - @inline def asIf[A](ifTrue: => A, ifFalse: A): Observable[A] = source.map { + @inline def toggle[A](ifTrue: => A, ifFalse: A): Observable[A] = source.map { case true => ifTrue case false => ifFalse } - @inline def asIf[A: Monoid](ifTrue: => A): Observable[A] = asIf(ifTrue, Monoid[A].empty) + @inline def toggle[A: Monoid](ifTrue: => A): Observable[A] = toggle(ifTrue, Monoid[A].empty) - @inline def not: Observable[Boolean] = source.map(x => !x) + @inline def negated: Observable[Boolean] = source.map(x => !x) } @inline implicit class IterableOperations[A](private val source: Observable[Iterable[A]]) extends AnyVal { diff --git a/reactive/src/test/scala/colibri/ReactiveSpec.scala b/reactive/src/test/scala/colibri/ReactiveSpec.scala index 6aaf150d..7e1505e4 100644 --- a/reactive/src/test/scala/colibri/ReactiveSpec.scala +++ b/reactive/src/test/scala/colibri/ReactiveSpec.scala @@ -612,12 +612,12 @@ class ReactiveSpec extends AsyncFlatSpec with Matchers { case class EventB(s: String) extends Event Owned(SyncIO { - val eventVar = Var[Event](EventA(0)) - val eventNotAVar = Var[Event](EventB("")) + val eventVar: Var[Event] = Var[Event](EventA(0)) + val eventNotAVar: Var[Event] = Var[Event](EventB("")) - val eventAVarOption = eventVar.prism(GenPrism[Event, EventA]) - val eventAVarOption2 = eventVar.subType[EventA] - val eventNotAVarOption = eventNotAVar.prism(GenPrism[Event, EventA]) + val eventAVarOption: Option[Var[EventA]] = eventVar.prism(GenPrism[Event, EventA]) + val eventAVarOption2: Option[Var[EventA]] = eventVar.subType[EventA] + val eventNotAVarOption: Option[Var[EventA]] = eventNotAVar.prism(GenPrism[Event, EventA]) eventAVarOption.isDefined shouldBe true eventAVarOption2.isDefined shouldBe true