title: It is ok to call observeForever() on Livedata returned by Transformations.map() inside ViewModel?
body: <p>I tried to use LiveData Transformations.map() to check the result and update the UI. But Transformations.map() callback not triggered without an observer. </p>
  
  <p><strong>So is it good way to call <code>observeForever {}</code> on livedata returned by Tranformations.map? And remove obervers on onCleared on ViewModel?</strong></p>
  
  <pre><code>private lateinit var map: LiveData&lt;Unit&gt;
  
      fun getAppConfiguration(): MutableLiveData&lt;TopRatedMoviesResponse&gt; {
          progressDialogVisibleLiveData.postValue(true)
  
          val appConfigurationLiveData = MutableLiveData&lt;TopRatedMoviesResponse&gt;()
  
          val appConfigurationSourceLiveData : MutableLiveData&lt;DataResult&gt; = splashScreenRepository.getAppConfiguration(getApplication())
  
          map = Transformations.map(appConfigurationSourceLiveData) { dataResult -&gt;
              progressDialogVisibleLiveData.postValue(false)
  
              when (dataResult) {
                  is DataResultSuccess -&gt; {
                      appConfigurationLiveData.postValue(dataResult.data as TopRatedMoviesResponse)
                  }
  
                  is DataResultFailed -&gt; {
                      when (dataResult.errorCode) {
                          HTTPError.NO_INTERNET -&gt; {
                              errorDialogVisibleLiveData.postValue(dataResult)
                          }
  
                          HTTPError.BAD_REQUEST -&gt; {
                              errorDialogVisibleLiveData.postValue(dataResult)
                          }
  
                          HTTPError.UNAUTHORISED -&gt; {
                              unAuthorisedEventLiveData.postValue(true)
                          }
  
                          HTTPError.FORBIDDEN, HTTPError.NOT_FOUND, HTTPError.INTERNAL_SERVER_ERROR, HTTPError.UNKNOWN -&gt; {
                              errorDialogVisibleLiveData.postValue(dataResult)
                          }
                      }
                  }
              }
          }
          map.observeForever {  }
  
          return appConfigurationLiveData
      }
  
      override fun onCleared() {
          super.onCleared()
  
          map.removeObserver {  }
      }
  </code></pre>