title: In RX how to combine two sources of different types
body: <p><strong>Set up:</strong></p>
  
  <ul>
  <li>First <code>IObservable</code> produces values of type <em>A</em></li>
  <li>Second <code>IObservable</code> produces values of type <em>B</em></li>
  <li>They produce value at different pace (quite fast, up to every 10 ms)</li>
  </ul>
  
  <p><strong>What I am trying to achieve:</strong></p>
  
  <p>Every <em>N</em> time (N is quite slow about 500 ms) the call has to be done to the service and provide latest values from both <em>First</em> and <em>Second</em> <code>IObservable</code>.</p>
  
  <p><strong>Question:</strong>
  I wonder how could I do using RX.</p>
  
  <p><strong>Current solution (Non working)</strong>:</p>
  
  <pre><code>var stateObs = from drag in dragObs.MostRecent(0).ToObservable()
                  from roll in rollObs.MostRecent(0).ToObservable()
                  select new ClientState
                              {
                                  FileDragPerc = drag,
                                  PhoneRoll = roll,
                                  PendingFileType = FileType.Image,
                                  TransferState = TransferState.SelectiveTransfer
                              };
  
  stateObs.Sample(TimeSpan.FromMilliseconds(300))
          .Subscribe(x =&gt; _lsService.SetClientStateAsync(x),
                      x =&gt; Debug.WriteLine("Error in observable "),
                      () =&gt; Debug.WriteLine("Error observable finished! "));
  </code></pre>