Created
January 11, 2019 23:59
-
-
Save adam-arold/2e8dc982aa984ae6d98d2c0c5abf5f8e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun <T: Event> Observable<T>.onEvent(fn: (Event) -> Unit){ | |
onEvent(object : Listener<T> { | |
override fun accept(event: T) { | |
fn(event) | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment