Multiple actions in On.click

27 views
Skip to first unread message

Julia Childs

unread,
Apr 2, 2015, 9:37:48 PM4/2/15
to mac...@googlegroups.com
Hello, I'm trying to update three slot[TextView]s, however, the only slot that gets updated in the very last one.  My code snippet is:

...
On.click {
  val newBTCData = fBTCData()
  capLast <~ newBTCData.map(p => text(p._1)) <~ fat
  capAsk  <~ newBTCData.map(p => text(p._2)) <~ med
  cap24h  <~ newBTCData.map(p => text(p._3)) <~ med
}
...

How can I update multiple slots in the same click event?  Thanks for any help on this.

Nick Stanchenko

unread,
Apr 2, 2015, 10:10:19 PM4/2/15
to mac...@googlegroups.com
Hi,

You can chain the UI actions together with the “~” operator, like this:


On.click {
  val newBTCData = fBTCData()
  (capLast <~ newBTCData.map(p => text(p._1)) <~ fat) ~
  (capAsk  <~ newBTCData.map(p => text(p._2)) <~ med) ~
  (cap24h  <~ newBTCData.map(p => text(p._3)) <~ med)
}

See http://macroid.github.io/guide/UiActions.html#composing.

Nick
--
You received this message because you are subscribed to the Google Groups "macroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macroid+u...@googlegroups.com.
To post to this group, send email to mac...@googlegroups.com.
Visit this group at http://groups.google.com/group/macroid.
To view this discussion on the web visit https://groups.google.com/d/msgid/macroid/c07cd5cd-e724-493e-8387-55ca678681da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Julia Childs

unread,
Apr 2, 2015, 10:19:55 PM4/2/15
to mac...@googlegroups.com
Sweet, thanks.  I must have missed that part in the docs.
Reply all
Reply to author
Forward
0 new messages