/*
 * Copyright 2018 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.google.android.gnd.rx;

import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.LiveDataReactiveStreams;
import io.reactivex.BackpressureStrategy;
import io.reactivex.Flowable;
import io.reactivex.Observable;

public abstract class RxLiveData {

  /** Container for static helper methods. Do not instantiate. */
  private RxLiveData() {}

  public static <T> LiveData<T> fromObservable(Observable<T> observable) {
    return LiveDataReactiveStreams.fromPublisher(
        observable.toFlowable(BackpressureStrategy.BUFFER));
  }

  // TODO: Does LiveData properly dispose of Rx subscriptions?
  // TODO: Handle errors.
  public static <T> LiveData<T> fromFlowable(Flowable<T> flowable) {
    return LiveDataReactiveStreams.fromPublisher(flowable);
  }
}

@@ -744,86 +744,12 @@
 vex.
-BackpressureStrategy;%0Aimport io.reactivex.Flowable;%0Aimport io.reactivex.Observ
+Flow
 able
@@ -884,262 +884,8 @@
 %7B%7D%0A%0A
-  public static %3CT%3E LiveData%3CT%3E fromObservable(Observable%3CT%3E observable) %7B%0A    return LiveDataReactiveStreams.fromPublisher(%0A        observable.toFlowable(BackpressureStrategy.BUFFER));%0A  %7D%0A%0A  // TODO: Does LiveData properly dispose of Rx subscriptions?%0A
   //

Clean up RxLiveData util docs and code.