// create an event source val clicks = EventSource[Unit] // setup a button to fire events button <~ On.click(Ui(clicks.fire(()))) // a more useful event stream val randomInts = clicks.map(_ ⇒ scala.util.Random.nextInt().toString) // the caption will update with each button click textView <~ randomInts.map(text)
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter