title: How to refresh ViewModel data using Kotlin lazy loading coroutine?
body: <p>I am trying to implement a SwipeToRefreshLayout in a weather app I'm building.  When the user swipes to refresh, the data in the ViewModel should be updated, and then the view should be updated accordingly.</p>
  
  <p>Here is a snippet of my CurrentWeatherFragment:</p>
  
  <pre><code>override fun onActivityCreated(savedInstanceState: Bundle?) {
          super.onActivityCreated(savedInstanceState)
          viewModel = ViewModelProviders.of(this, viewModelFactory)
                  .get(WeatherResponseViewModel::class.java)
  
          pullToRefresh.setOnRefreshListener(this)
  
          bindUI()
      }
  
      override fun onRefresh() {
          viewModel = ViewModelProviders.of(this, viewModelFactory)
                  .get(WeatherResponseViewModel::class.java)
  
          bindUI()
          pullToRefresh.isRefreshing = false
      }
  
      private fun bindUI() = launch {
          val currentWeather = viewModel.weather.await()
          currentWeather.observe(this@CurrentWeatherFragment, Observer {
              if (it == null) return@Observer
  
              loading_icon.visibility = View.GONE
  
              updateLocation("Raleigh")
              updateDateToToday()
              updateTemperatures(it.currently.temperature.roundToInt(),
                      it.currently.apparentTemperature.roundToInt(),
                      it.daily.data[0].temperatureMin.roundToInt(),
                      it.daily.data[0].temperatureMax.roundToInt())
              updateDescription(it.currently.summary)
              updateEnvironmentals((it.currently.humidity * 100).roundToInt(), it.currently.windSpeed.roundToInt())
              updateWeatherIcon(it.currently.icon)
              updateTempChart(it)
              updatePrecipChart(it)
          })
      }
  </code></pre>
  
  <p>my ViewModel:</p>
  
  <pre><code>class WeatherResponseViewModel (
          private val forecastRepository: ForecastRepository,
          unitProvider: UnitProvider
  ) : ViewModel() {
  
      private val unitSystem = unitProvider.getUnitSystem()
  
      val isMetric: Boolean
          get() = unitSystem == UnitSystem.METRIC
  
      val weather by lazyDeferred {
          forecastRepository.getWeather()
      }
  
  }
  </code></pre>
  
  <p>and my lazyDeferred implementation:</p>
  
  <pre><code>fun &lt;T&gt; lazyDeferred(block: suspend CoroutineScope.() -&gt; T): Lazy&lt;Deferred&lt;T&gt;&gt; {
      return lazy {
          GlobalScope.async {
              block.invoke(this)
          }
      }
  }
  </code></pre>
  
  <p>Currently, with this setup, the forecastRepository.getWeather() function in the ViewModel is called when the fragment is loaded either on app launch or when switching to it, but on the swipe to refresh, it isn't being called.  How can I get the weather variable in the ViewModel to update so that the view can observe the change?</p>