Is it to use ScalaJS DOM and use the following?
org.scalajs.dom.setTimeout( () => {
// Work
}, 1000)
Is there another way or a better way within the context of ScalaJS?
Starting with Scala.js 0.6.0, there is a more standard way, and more idiomatic Scala, to do it:
import scala.scalajs.js.timers._
setTimeout(1000) { // note the absence of () =>
// work
}
There isn't a better way. If you want you can wrap it in a helper and call it whatever you want, but by default that's it.