Skip to content

Instantly share code, notes, and snippets.

@rtyley
Created December 10, 2013 21:40
Show Gist options
  • Select an option

  • Save rtyley/7900726 to your computer and use it in GitHub Desktop.

Select an option

Save rtyley/7900726 to your computer and use it in GitHub Desktop.
implicit class TextFieldOps(field: TextField) {
/** Returns a stream of text field values entered in the given text field.
*
* @param field the text field
* @return an observable with a stream of text field updates
*/
def textValues: Observable[String] = Observable {
observer => {
val reaction: Reaction = {
case ..
}
field subscribe reaction
Subscription { /* do something on unsubscribe */ }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment