title: RxSwift - Custom class as observable
body: <p>I'm creating a custom generic TableView model to work with MVVM and RxSwift. I'm aware of the <code>RxTableViewSectionedReloadDataSource</code> class but not willing to use it now in my project.</p>
  
  <p>The model is created and working</p>
  
  <pre><code>typealias TableViewModel = TableModel&lt;CellDescriptor&gt;
  
  class TableModel&lt;T&gt; {
  
      var sections = [SectionModel&lt;T&gt;]()
  
      func add(item: SectionModel&lt;T&gt;) {
          sections.append(item)
      }
  
      // More funcs there...
  }
  </code></pre>
  
  <p>I created an instance inside my ViewModel as such :</p>
  
  <pre><code>var tableViewModel = Variable&lt;TableViewModel&gt;(TableViewModel())
  </code></pre>
  
  <p>And then listen to event in my viewController</p>
  
  <pre><code>viewModel.tableViewModel.asObservable().subscribe({ [weak self] value in
      self?.tableView.reloadData()
  }).addDisposableTo(dispose)
  </code></pre>
  
  <p>Several questions here (I'm fairly new to FRP)
   :</p>
  
  <ul>
  <li><p>How can I "emit" an event to trigger my subscription in the viewController from my custom class?
  I know that a solution would be to create my sections array as a RxSwift <code>Variable()</code> and then listen to it directly, but wonder if there's a way to make a class (or struct) itself Observable.</p></li>
  <li><p>Is there a better approach to this problem ? I went through the RxSwift playground and example project but it sounds like there's a thousand ways to do the same thing. Maybe an <code>Observable</code> is not what i would be looking for. :) </p></li>
  </ul>