Skip to content

Commit

Permalink
Misc: Undo some changes that are not necessary anymore without value-…
Browse files Browse the repository at this point in the history
…discard compiler option, and some other minor fixes.
  • Loading branch information
raquo committed Dec 30, 2020
1 parent 8e2689c commit 89d71be
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Expand Up @@ -16,7 +16,7 @@ val filterScalacOptions = { options: Seq[String] =>

scalaVersion := "2.13.4"

crossScalaVersions := Seq("2.12.11", "2.13.4")
crossScalaVersions := Seq("2.12.12", "2.13.4")

scalacOptions ~= filterScalacOptions

Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Expand Up @@ -10,4 +10,4 @@ addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.8")

addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.8.1")

addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.16")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.16")
2 changes: 1 addition & 1 deletion src/main/scala-2.12/scala/annotation/unused.scala
@@ -1,3 +1,3 @@
package scala.annotation

final class unused extends deprecated("unused", "unused")
final class unused extends deprecated("unused", "unused")
4 changes: 1 addition & 3 deletions src/main/scala/com/raquo/airstream/core/Observer.scala
Expand Up @@ -34,9 +34,7 @@ trait Observer[-A] {
/** Like `contramap` but with `collect` semantics: not calling the original observer when `pf` is not defined */
def contracollect[B](pf: PartialFunction[B, A]): Observer[B] = {
Observer.withRecover(
nextValue => {
pf.runWith(onNext)(nextValue)
},
nextValue => pf.runWith(onNext)(nextValue),
{ case nextError => onError(nextError) }
)
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/scala/com/raquo/airstream/core/ObserverList.scala
Expand Up @@ -8,9 +8,7 @@ class ObserverList[Obs](private val observers: js.Array[Obs]) extends AnyVal {

@inline def apply(index: Int): Obs = observers(index)

@inline def push(observer: Obs): Unit = {
observers.push(observer)
}
@inline def push(observer: Obs): Unit = observers.push(observer)

/** @return whether observer was removed (`false` if it wasn't in the list) */
def removeObserverNow(observer: Obs): Boolean = {
Expand Down
Expand Up @@ -68,4 +68,4 @@ class EventBusStream[A] private[eventbus] () extends EventStream[A] with Interna
// dom.console.log("EventBusStream STOPPED!", this.toString)
sourceStreams.foreach(sourceStream => Transaction.removeInternalObserver(sourceStream, observer = this))
}
}
}
Expand Up @@ -17,9 +17,7 @@ class DelayEventStream[A](
js.timers.setTimeout(delayMillis.toDouble) {
//println(s"> init trx from DelayEventStream.onNext($nextValue)")
new Transaction(fireValue(nextValue, _))
()
}
()
}

override def onError(nextError: Throwable, transaction: Transaction): Unit = {
Expand Down
Expand Up @@ -48,8 +48,6 @@ class PeriodicEventStream[A](
}
setNext()
})

()
}

private def setNext(): Unit = {
Expand All @@ -63,7 +61,6 @@ class PeriodicEventStream[A](
resetTo(initial, tickNext = false)
case Failure(err) =>
new Transaction(fireError(err, _))
()
}
}

Expand Down
1 change: 0 additions & 1 deletion src/main/scala/com/raquo/airstream/ownership/Owner.scala
Expand Up @@ -39,7 +39,6 @@ trait Owner {
val index = subscriptions.indexOf(subscription)
if (index != -1) {
subscriptions.splice(index, deleteCount = 1)
()
} else {
throw new Exception("Can not remove Subscription from Owner: subscription not found.")
}
Expand Down
Expand Up @@ -13,5 +13,3 @@ object Calculation {
value
}
}

case class Effect[V](name: String, value: V)
3 changes: 3 additions & 0 deletions src/test/scala/com/raquo/airstream/fixtures/Effect.scala
@@ -0,0 +1,3 @@
package com.raquo.airstream.fixtures

case class Effect[V](name: String, value: V)

0 comments on commit 89d71be

Please sign in to comment.