Created
November 7, 2022 07:59
-
-
Save Wajahat-Jawaid/d93e3087a802c82d67b11c139af12765 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 getSubscribersCount(blogUrl: String) = liveData(Dispatchers.IO) { | |
try { | |
emit(Resource.success(data = repository.getSubscribersCount(blogUrl))) | |
} catch (exception: Exception) { | |
emit(Resource.error(data = null, message = exception.message ?: "Error!!!")) | |
} | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment