Skip to content

Instantly share code, notes, and snippets.

@MulticolorWorld
Created September 8, 2018 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MulticolorWorld/85c42348c5b4755efef7cf326cba6774 to your computer and use it in GitHub Desktop.
Save MulticolorWorld/85c42348c5b4755efef7cf326cba6774 to your computer and use it in GitHub Desktop.
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