Really helpful article. Can you please share your BaseViewModel class too?
Hey @sarimahmed93 I'm glad you learnt a thing form it. Here's the BaseViewmodel from an old project i worked on. Nothing really fancy. Just extending ViewModel.
abstract class BaseViewModel(private val lifeCycleReceiver: LifecycleReceiver = LifecycleReceiverImpl()) : ViewModel(), LifecycleReceiver by lifeCycleReceiver { private val compositeContainer = CompositeDisposable() var mainNavigator: MainNavigator? = null override fun onCleared() { super.onCleared() compositeContainer.clear() } fun Disposable.addToContainer() = compositeContainer.add(this) }
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Really helpful article. Can you please share your BaseViewModel class too?
Hey @sarimahmed93 I'm glad you learnt a thing form it. Here's the BaseViewmodel from an old project i worked on. Nothing really fancy. Just extending ViewModel.