Created
December 21, 2019 16:10
-
-
Save gastsail/bc5ed73069fae77a6f9bd03aaeda5445 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class EventsViewModel(private val useCase: IEvent):ViewModel() { | |
| val fetchEventList = liveData(Dispatchers.IO){ | |
| try { | |
| val eventList = useCase.getEvents() | |
| emit(eventList) | |
| }catch (e:Exception){ | |
| Crashlytics.logException(e.cause) | |
| emit(Resource.Failure(e.cause!!)) | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment