package akkaviz

import org.scalajs.dom._
import org.scalajs.dom.raw.Element

package object frontend {

  implicit class RichElement(elem: Element) {
    def onClick(f: () => Any): Unit = {
      elem.addEventListener("click", { (e: Event) => f() }, true)
    }

    def onEnter(f: () => Any): Unit = {
      elem.addEventListener("keydown", { (e: KeyboardEvent) =>
        val enterKeyCode = 13
        if (e.keyCode == enterKeyCode)
          f()
      }, true)
    }
  }

}

package akkaviz

import org.scalajs.dom._
import org.scalajs.dom.raw.Element

package object frontend {

  implicit class RichElement(elem: Element) {
    def onClick(f: () => Any): Unit = {
      elem.addEventListener("click", { (e: Event) => f() }, true)
    }

    def onEnter(f: () => Any): Unit = {
      elem.addEventListener("keydown", { (e: KeyboardEvent) =>
        val enterKeyCode = 13
        if (e.keyCode == enterKeyCode)
          f()
      }, true)
    }
  }

  type ActorPath = String

  case class ActorLink(from: ActorPath, to: ActorPath)

}

Define ActorLink and ActorPath alias
Define ActorLink and ActorPath alias
