Closed abdulmalekDery closed 4 years ago
@abdulmalekDery
Hi, you can return the liveData
in the coroutines context.
suspend fun postRegister(error: (String) -> Unit, request: RegisterRequest) = withContext(Dispatchers.IO) {
val liveData = MutableLiveData<ResponseWrapper<RegisterResponse>>()
// skip stubs
liveData // return liveData
}
thanks I will try that
I'm trying to understanding this architecture by coding example and I followed the project set up till I stuck with that compile time error
Type mismatch required LiveData<TypeVariable(T)> found Unit
in the viewModel I have code like that for register request
in the repository I have the following code
the network client request look like that
the authService code
what I did wrong and how to make postRegister in the repository return LiveData<TypeVariable(T)> instead of Unit