2

Here is an example from the scala.rx doc:

package tutorial.webapp

import rx.core.{Rx, Var}
import rx._
import rx.ops._

import scala.concurrent.Promise
import scala.concurrent.duration._
import scala.scalajs.js.JSApp
import scala.scalajs.js.annotation.JSExport
import scala.concurrent.ExecutionContext.Implicits.global

/**
 * Created by IDEA on 29/10/15.
 */
object RxAddtionalOps extends JSApp {
  @JSExport
  override def main(): Unit = {
    mapDemo
    filterDemo
    asyncDemo
    async2
    timer1
  }

  def delay1: Unit = {
    val a = Var(10)
    val b = a.delay(250 millis)
    a() = 5
    println(b())
    eventually{
      println(b)
    }
  }
}

I got this error on sbt when compiling:

[error] /Users/kaiyin/personal_config_bin_files/workspace/scalajsHandson/src/main/scala/tutorial/webapp/RxAddtionalOps.scala:43: not found: value eventually
[error]     eventually{
[error]     ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed
[error] Total time: 1 s, completed 30 oct. 2015 11:15:07

Where does the eventually function come from? Am I missing any imports?

qed
  • 22,298
  • 21
  • 125
  • 196

1 Answers1

2

It's defined in utest, which is a author's framework for tests. Since it's a test dependency it doesn't come bundled with scalarx. BTW, the very same functionality presented in scalatest.

om-nom-nom
  • 62,329
  • 13
  • 183
  • 228
  • Ok, so this means it's only relevant in `sbt test`? Is there something similar to be used in non-test files? – qed Oct 30 '15 at 12:05