Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Operator debounce2 #1094

Merged
merged 2 commits into from
Apr 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions rxjava-core/src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
import rx.observers.SafeSubscriber;
import rx.operators.OnSubscribeFromIterable;
import rx.operators.OnSubscribeRange;
import rx.operators.OperationDebounce;
import rx.operators.OperationDelay;
import rx.operators.OperationGroupByUntil;
import rx.operators.OperationGroupJoin;
Expand Down Expand Up @@ -90,6 +89,8 @@
import rx.operators.OperatorCast;
import rx.operators.OperatorCombineLatest;
import rx.operators.OperatorConcat;
import rx.operators.OperatorDebounceWithSelector;
import rx.operators.OperatorDebounceWithTime;
import rx.operators.OperatorDefaultIfEmpty;
import rx.operators.OperatorDefer;
import rx.operators.OperatorDematerialize;
Expand Down Expand Up @@ -3378,7 +3379,7 @@ public final Integer call(Integer t1, T t2) {
* within a computed debounce duration
*/
public final <U> Observable<T> debounce(Func1<? super T, ? extends Observable<U>> debounceSelector) {
return create(OperationDebounce.debounceSelector(this, debounceSelector));
return lift(new OperatorDebounceWithSelector<T, U>(debounceSelector));
}

/**
Expand Down Expand Up @@ -3410,7 +3411,7 @@ public final <U> Observable<T> debounce(Func1<? super T, ? extends Observable<U>
* @see #throttleWithTimeout(long, TimeUnit)
*/
public final Observable<T> debounce(long timeout, TimeUnit unit) {
return create(OperationDebounce.debounce(this, timeout, unit));
return lift(new OperatorDebounceWithTime<T>(timeout, unit, Schedulers.computation()));
}

/**
Expand Down Expand Up @@ -3445,7 +3446,7 @@ public final Observable<T> debounce(long timeout, TimeUnit unit) {
* @see #throttleWithTimeout(long, TimeUnit, Scheduler)
*/
public final Observable<T> debounce(long timeout, TimeUnit unit, Scheduler scheduler) {
return create(OperationDebounce.debounce(this, timeout, unit, scheduler));
return lift(new OperatorDebounceWithTime<T>(timeout, unit, scheduler));
}

/**
Expand Down Expand Up @@ -6831,7 +6832,7 @@ public final Observable<T> throttleLast(long intervalDuration, TimeUnit unit, Sc
* @see #debounce(long, TimeUnit)
*/
public final Observable<T> throttleWithTimeout(long timeout, TimeUnit unit) {
return create(OperationDebounce.debounce(this, timeout, unit));
return debounce(timeout, unit);
}

/**
Expand Down Expand Up @@ -6866,7 +6867,7 @@ public final Observable<T> throttleWithTimeout(long timeout, TimeUnit unit) {
* @see #debounce(long, TimeUnit, Scheduler)
*/
public final Observable<T> throttleWithTimeout(long timeout, TimeUnit unit, Scheduler scheduler) {
return create(OperationDebounce.debounce(this, timeout, unit, scheduler));
return debounce(timeout, unit, scheduler);
}

/**
Expand Down
318 changes: 0 additions & 318 deletions rxjava-core/src/main/java/rx/operators/OperationDebounce.java

This file was deleted.

Loading