thoughtworksinc / latestevent.scala   2.0.0

MIT License GitHub

bidirectional data-binding and routing for Scala.js

Scala versions: 3.x 2.13 2.12 2.11
Scala.js versions: 1.x 0.6


Latest version Scaladoc Scala CI

LatestEvent.scala is a library to track the latest events from HTML DOM objects and other event targets. It can be used with Binding.scala and html.scala for bidirectional data-binding and routing.

Getting Started

def rootView = {
  val inputBinding = html"<input>"
  val value = Binding {
    val input = inputBinding.bind

    // Automatically recaculate whenever `input` is changed
    Your input value is ${value.bind}

@JSExport def main(): Unit = {
  render(document.body, rootView)

It can be also used as an alternative to a routing library. See the todo app for example.