title: RxSwift practice to show/hide ActivityIndicator
body: <p>Let's say we have this pseudocode representing a network request call and show/hide an activity indicator, using RxSwift:</p>
  <pre><code>func performRequest() {
     isLoading.accept(true)
     self.network.executeRequest()
         .subscribe(onNext: {
             self.isLoading.accept(false)
         }, onError: {
             self.isLoading.accept(false)
         })
  }
  </code></pre>
  <p>The function <code>executeRequest</code> returns either an <code>Observable</code> or <code>Single</code>.</p>
  <p>I am not feeling comfortable with having to write twice the same code, for onNext/onSuccess and onError, basically doing the same.</p>
  <p>I am looking for suggestions to minimize/improve turning off the activity indicator, like for example handling all events of the request in a single statement and avoid using the <code>subscribe</code> function. Or maybe there are other suggestions?</p>