Created
February 13, 2021 08:27
-
-
Save RohitSurwase/063be12bf3ec5e161d2b4b7b8c8cc76a to your computer and use it in GitHub Desktop.
AacMviViewModel for Activities with DataHolder
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
open class AacMviViewModelDH<STATE, EFFECT, EVENT>(application: Application, private val aacMviDH: AacMviDH<STATE, EFFECT>) : | |
AndroidViewModel(application), ViewModelContract<EVENT> { | |
fun viewStates(): LiveData<STATE> = aacMviDH.stateLiveData | |
fun viewEffects(): LiveData<EFFECT> = aacMviDH.effectLiveData | |
@CallSuper | |
override fun process(viewEvent: EVENT) { | |
Log.d(TAG, "processing viewEvent : $viewEvent") | |
} | |
override fun onCleared() { | |
super.onCleared() | |
aacMviDH.onCleared() | |
Log.d(TAG, "onCleared") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment