Last active
May 19, 2020 21:53
-
-
Save sasssass/33eb22d8bb94f24726b8fb7bc2e9219b 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
fun <T> apiCall(emitter: RemoteErrorEmitter,responseFunction: suspend () -> T) : LiveData<T?>{ | |
return liveData { | |
val respone = privateApiCall(emitter,{responseFunction()}) | |
emit(respone) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment