Created
September 8, 2018 10:46
-
-
Save MulticolorWorld/85c42348c5b4755efef7cf326cba6774 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
open class MastodonRequest<T>{ | |
fun execute(): T { | |
//普通のexecute | |
} | |
fun single(): Single<T> { | |
return Single.create { | |
try { | |
it.onSuccess(execute()) | |
} catch (e: Throwable) { | |
it.onError(e) | |
} | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment