title: RxJava - Observable which emits items which are new or changed
body: <p>I am a newbie in reactive world and trying to implement the following scenario with rxjava/rxandroid 2.x.</p>
  
  <p>I have a local data set as ArrayList mItems in Application class. The same data set is synchronized with server and updated every time user opens the app. However before server returns the response, I want to display the local data set in RecycleView backed by adapter. <strong>As soon as the response is returned, the adapter should update the list with delta and without disturbing the order in the UI.</strong></p>
  
  <p>So far I have tried this:</p>
  
  <pre><code>public Observable&lt;List&lt;Item&gt;&gt; getItemsObservable() {
      Observable&lt;List&lt;Item&gt;&gt; observeApi = itemServiceAPI.getItemsForUser(accountId);
      if (mItems != null) {
          return Observable.just(mItems).mergeWith(observeApi);
      } else {
          return observeApi;
      }
  }
  </code></pre>
  
  <p>To update the UI, the above method is invoked like this:</p>
  
  <pre><code>Observable&lt;List&lt;Item&gt;&gt; itemsObservable = appContext.getItemsObservable();
              itemsObservable.subscribeOn(Schedulers.io())
                      .observeOn(AndroidSchedulers.mainThread())
                      .subscribe(new DefaultObserver&lt;List&lt;Item&gt;&gt;() {
                          @Override
                          public void onNext(List&lt;Item&gt; Items) {
                              // Code to update the adapter
                          }
  
                          @Override
                          public void onError(Throwable e) {
  
                          }
  
                          @Override
                          public void onComplete() {
  
                          }
                      });
  </code></pre>
  
  <p>With this I get the onNext called twice for each local data set and remote data set. How to achieve the desired functionality? Does it need use of filter operators to exclude items?</p>
  
  <p>What's the best approach to achieve this?</p>