Guest User

Untitled

a guest
Feb 21st, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. private fun <T> Observable<T>.subscribe(onNext:(T)-> Unit = {}, context: KFunction<out Unit>? = null) {
  2. this.subscribe({}, { ErrorController().onError("[ ${context?.name} ]",it) })
  3. }
  4.  
  5. //exemple
  6. private fun onReceiveShareAction(userId: String) {
  7. messenger.sendShareMessage(Recipient(userId)).subscribe(context = ::onReceiveShareAction)
  8. }
Add Comment
Please, Sign In to add comment