Created
October 4, 2019 14:53
-
-
Save AlexMisiulia/7cdeeb67a188434da8b76732410eeb06 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
data class PractitionersModel(val data: Any) | |
object Network { | |
fun requestPracticioners(onSuccess: (PractitionersModel) -> Unit, onError: (Throwable) -> Unit) | |
{ | |
// типа сетевой запрос | |
} | |
} | |
interface Activity { | |
val adapter: Adapter | |
fun onCreate() { | |
Network.requestPracticioners(onSuccess = {practicioners -> | |
adapter.setPracticioners(practicioners) | |
}, onError = { | |
displayError(it) | |
}) | |
} | |
fun displayError(it: Throwable) | |
} | |
interface Adapter { | |
fun setPracticioners(practicioners: PractitionersModel) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment