package com.przemyslawlusnia.vocabularycreator.core;

import rx.Observable;
import rx.Scheduler;
import rx.Subscription;
import rx.subscriptions.Subscriptions;

public abstract class RxUseCase<T> {

  private final Scheduler executionScheduler;
  private Subscription subscription = Subscriptions.empty();
  // todo serve subscription (with unsubscription) here, add observeOn scheduler

  public RxUseCase(Scheduler executionScheduler) {
    this.executionScheduler = executionScheduler;
  }

  protected abstract Observable<T> buildUseCaseObservable();

  public Observable<T> execute() {
    return buildUseCaseObservable().subscribeOn(executionScheduler);
  }
  // todo put creation of Observable here if possible (mapping can block possibility)
}

@@ -93,71 +93,8 @@
 ler;
-%0Aimport rx.Subscription;%0Aimport rx.subscriptions.Subscriptions;
 %0A%0Apu
@@ -178,150 +178,8 @@
 ler;
-%0A  private Subscription subscription = Subscriptions.empty();%0A  // todo serve subscription (with unsubscription) here, add observeOn scheduler
 %0A%0A  
@@ -452,96 +452,10 @@
 r);%0A
+
   %7D%0A
-  // todo put creation of Observable here if possible (mapping can block possibility)%0A
 %7D%0A

remove unnecessary thing