impure run
-
impure run 사용하기web/mhtml 2021. 10. 28. 00:15
코드 import mhtml._ import org.scalajs.dom import scala.scalajs.js object MHtmlTest { def view(): Unit = { val x: Var[List[String]] = Var(List("a", "b", "c")) val first: Var[String] = Var("Z") // x.map(list => first := list.head).impure.run(_ => ()) x.impure.run(list => first := list.head) val content = {first} x.update(list => e.target.value.asInstanceOf[String] :: list) } /> mount(dom.document.g..