title: How can I get value from observable
body: <p>I have this function in my Kotlin project. I'm using <code>ReactiveNetwork</code> -
   Android library listening network connection state and Internet connectivity with RxJava Observables. I'm new to reactive programming and now I need to refactor this method to use this in many places. How can I refactor this method to just return state of internet connectivity (isConnected)? </p>
  
  <pre><code>private fun downloadProductIfConnected(arguments: Bundle){
      ReactiveNetwork.checkInternetConnectivity().subscribeOn(Schedulers.io())
              .observeOn(AndroidSchedulers.mainThread())
              .subscribe{ isConnected -&gt;
                  if (isConnected){
                      downloadAndOpenProduct(arguments)
                  }else{
                      displayConnectionErrorDialog(arguments)
                  }
              }
  }
  </code></pre>