这是来自 scala.rx 文档的示例:
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)
}
}
}
编译时我在 sbt 上收到此错误:
[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
函数从何eventually
而来?我错过了任何进口吗?