title: RxSwift. What to use for Observable<Void>?
body: <p>Writing a project on <strong>MVVM</strong> and trying to bind everything with <strong>RxSwift</strong>.
  Unfortunately I did not manage to find a proper way how to bind an actions.</p>
  
  <p>For example, I have a table and a simple cells with one button - "Select".</p>
  
  <p>For this purposes I will have two view models: <code>ListViewModel</code> &amp; <code>CellViewModel</code></p>
  
  <p><code>ListViewModel</code> will be creating an array of <code>CellViewModel</code> and need to subscribe on selection event(custom event). </p>
  
  <p>Now I'm using BehaviorSubject for this purposes, but it looks ugly. Who can point me how it need to be implemented with <strong>RxSwift</strong>?</p>
  
  <pre><code>class CellViewModel {
  
      private let selectionSubject = BehaviorSubject&lt;Void&gt;(value: ())
  
      // Will be used by ListViewModel
      var selectionObservable: Observable&lt;Void&gt; {
          return selectionSubject.asObservable()
      }
  
      func subscribeOnSelection(_ observable: Observable&lt;Void&gt;, disposeBag: DisposeBag) {
          observable
              .bind(to: selectionSubject)
              .disposed(by: disposeBag)
      }
  
      private func autoSelect() {
          selectionSubject.on(next: ())
      }
  }
  
  class Cell: UITableViewCell {
      @IBOutlet private var selectionButton: UIButton!
  
      private let disposeBag = DisposeBag()
  
      func bind(to viewModel: CellViewModel) {
          viewModel.subscribeOnSelection(selectionButton.rx.tap.asObservable(), disposeBag: disposeBag)
      }
  }
  </code></pre>