macroid

PHOTO EMBED

Wed Dec 22 2021 06:26:36 GMT+0000 (Coordinated Universal Time)

Saved by @LeadingQ

// 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)
content_copyCOPY

https://47degrees.github.io/macroid/docs/guide/Advanced.html