title: How does kotlin use this by delegate to instantiate the viewmodel
body: <p>I was reading through the google android architecture example and came across this.Can someone explain to me how this delegate works? </p>
  
  <pre><code>private val viewModel by viewModels&lt;TasksViewModel&gt; { getViewModelFactory() }
  </code></pre>
  
  <p>where getViewModelFactory is an extension method that returns a ViewModelFactory and TasksViewModel is an instance of ViewModel()</p>
  
  <p>The way that I read this is similar to:</p>
  
  <pre><code>private val viewModel: TasksViewModel by Fragment.ViewModel(ViewModelFactory)
  </code></pre>
  
  <p>can someone elaborate on if my understanding is correct.</p>