title: Android: Override viewmodel object in child fragment using Koin?
body: <p>I have the following case here, I got 2 fragments:</p>
  <pre><code>LoginFragment : BaseAuthFragment
  RegFragment : BaseAuthFragment
  </code></pre>
  <p>and corresponding viewModels:</p>
  <pre><code>LoginViewModel : BaseAuthViewModel
  RegViewModel : BaseAuthViewModel
  </code></pre>
  <p>LoginFragment has a LoginViewModel object
  RegFragment has a RegViewModel object
  BaseAuthFragment has a BaseAuthViewModel object</p>
  <p>I am using Koin for dependency injection so that viewModel object declaration in BaseAuthFragment is smth like this:</p>
  <pre><code>private val viewModel: BaseAuthViewModel by viewModel()
  </code></pre>
  <p>BaseAuthViewModel keeps common livedata observable objects for both Login &amp;&amp; Reg fragments, like loading, error, etc..</p>
  <p>What I am trying to achieve is that I want to observe those common Livedata objects from BaseAuthViewModel inside of BaseAuthFragment, so that I don't have to copy the code in LoginFragment &amp;&amp; RegFragment separately.</p>
  <p>But inside of LoginFragment &amp;&amp; RegFragment I should already have LoginViewModel and RegViewModel, which are children of BaseAuthViewModel, so is it possible to somehow override the viewModel object type in child fragments ?</p>