title: How can I use .doOnNext() with Action2 (RxJava)
body: <p>Observables only emit one object, so <code>doOnNext()</code> is always called with an <a href="http://reactivex.io/RxJava/javadoc/rx/functions/Action1.html" rel="nofollow"><code>Action1</code></a>.  How can I use <a href="http://reactivex.io/RxJava/javadoc/rx/functions/Action2.html" rel="nofollow"><code>Action2</code></a> in a similar fashion?</p>
  
  <p>Can I combine 2 observables call an <code>Action2</code>?</p>
  
  <p>EDIT: Why would I want to do this? I am working on a checkout app. I have a view that in order to display correctly, it needs two pieces of data (1: tip% and 2: total cost). So if this view could react to an observable sequence as an <code>Action2</code>, I would be happy.</p>
  
  <p>EDIT2: Here's a method on the view mentioned previously. If this were an <code>Action1</code>, I could easily call it like I do with <code>.doOnNext()</code>. Are there operators that can operate similarly to <code>.doOnNext()</code> but take in an <code>Action2</code> as a parameter? Maybe something like <code>withLatestFrom()</code> that takes in an <code>Action2</code> instead of a <code>Func2</code>?</p>
  
  <pre><code>public Action2&lt;Money, List&lt;Integer&gt;&gt; displayGratuityOptions() {
          return (subtotal, gratuityPercents) -&gt; {
              removeAllTabs();
              for (final Integer percent : gratuityPercents) {
                  addTab(createTab(subtotal, percent));
              }
              addTab(createCustomGratuityTab());       
          };
      }
  </code></pre>