@@ -2,16 +2,13 @@ import {Operator} from '../Operator';
2
2
import { Subscriber } from '../Subscriber' ;
3
3
import { tryCatch } from '../util/tryCatch' ;
4
4
import { errorObject } from '../util/errorObject' ;
5
- import { bindCallback } from '../util/bindCallback' ;
6
5
7
- export function distinctUntilChanged < T > ( compare ?: ( x : T , y : T ) => boolean , thisArg ?: any ) {
8
- return this . lift ( new DistinctUntilChangedOperator ( thisArg ?
9
- < ( x : T , y : T ) => boolean > bindCallback ( compare , thisArg , 2 ) :
10
- compare ) ) ;
6
+ export function distinctUntilChanged < T > ( compare ?: ( x : T , y : T ) => boolean ) {
7
+ return this . lift ( new DistinctUntilChangedOperator ( compare ) ) ;
11
8
}
12
9
13
10
class DistinctUntilChangedOperator < T , R > implements Operator < T , R > {
14
- constructor ( private compare ? : ( x : T , y : T ) => boolean ) {
11
+ constructor ( private compare : ( x : T , y : T ) => boolean ) {
15
12
}
16
13
17
14
call ( subscriber : Subscriber < T > ) : Subscriber < T > {
@@ -23,7 +20,7 @@ class DistinctUntilChangedSubscriber<T> extends Subscriber<T> {
23
20
private value : T ;
24
21
private hasValue : boolean = false ;
25
22
26
- constructor ( destination : Subscriber < T > , compare ? : ( x : T , y : T ) => boolean ) {
23
+ constructor ( destination : Subscriber < T > , compare : ( x : T , y : T ) => boolean ) {
27
24
super ( destination ) ;
28
25
if ( typeof compare === 'function' ) {
29
26
this . compare = compare ;
0 commit comments