A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ThoughtWorksInc/LatestEvent.scala below:

ThoughtWorksInc/LatestEvent.scala: bidirectional data-binding and routing for Scala.js

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.

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

    // Automatically recaculate whenever `input` is changed
    LatestEvent.change(input).bind
    
    input.value
  }
  html"""<div>
    ${inputBinding.bind}
    Your input value is ${value.bind}
  </div>"""
}

@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.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4