Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fun printString(string: String) = println(string)
- /**
- * Prints successfully
- */
- Observable.just("Test string")
- .doOnNext{ printString(it) }
- .subscribe()
- /**
- * Prints successfully
- */
- Observable.just("Test string")
- .doOnNext(this::printString)
- .subscribe()
- /**
- * Does not print
- */
- Observable.just("Test string")
- .doOnNext { this::printString }
- .subscribe()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement