Skip to content
This repository was archived by the owner on Apr 20, 2018. It is now read-only.

Commit 01adf66

Browse files
Fixing Issue #862
1 parent 74b07f0 commit 01adf66

25 files changed

Lines changed: 322 additions & 430 deletions

dist/rx.all.compat.js

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4388,54 +4388,42 @@ var FlatMapObservable = (function(__super__){
43884388
return DistinctUntilChangedObservable;
43894389
}(ObservableBase));
43904390

4391-
function DistinctUntilChangedObserver(o, keyFn, comparer) {
4392-
this.o = o;
4393-
this.keyFn = keyFn;
4394-
this.comparer = comparer;
4395-
this.hasCurrentKey = false;
4396-
this.currentKey = null;
4397-
this.isStopped = false;
4398-
}
4399-
4400-
DistinctUntilChangedObserver.prototype.onNext = function (x) {
4401-
if (this.isStopped) { return; }
4402-
var key = x;
4403-
if (isFunction(this.keyFn)) {
4404-
key = tryCatch(this.keyFn)(x);
4405-
if (key === errorObj) { return this.o.onError(key.e); }
4406-
}
4407-
if (this.hasCurrentKey) {
4408-
comparerEquals = tryCatch(this.comparer)(this.currentKey, key);
4409-
if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); }
4410-
}
4411-
if (!this.hasCurrentKey || !comparerEquals) {
4412-
this.hasCurrentKey = true;
4413-
this.currentKey = key;
4414-
this.o.onNext(x);
4391+
var DistinctUntilChangedObserver = (function(__super__) {
4392+
inherits(DistinctUntilChangedObserver, __super__);
4393+
function DistinctUntilChangedObserver(o, keyFn, comparer) {
4394+
this.o = o;
4395+
this.keyFn = keyFn;
4396+
this.comparer = comparer;
4397+
this.hasCurrentKey = false;
4398+
this.currentKey = null;
4399+
__super__.call(this);
44154400
}
4416-
};
4417-
DistinctUntilChangedObserver.prototype.onError = function(e) {
4418-
if (!this.isStopped) {
4419-
this.isStopped = true;
4401+
4402+
DistinctUntilChangedObserver.prototype.next = function (x) {
4403+
var key = x, comparerEquals;
4404+
if (isFunction(this.keyFn)) {
4405+
key = tryCatch(this.keyFn)(x);
4406+
if (key === errorObj) { return this.o.onError(key.e); }
4407+
}
4408+
if (this.hasCurrentKey) {
4409+
comparerEquals = tryCatch(this.comparer)(this.currentKey, key);
4410+
if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); }
4411+
}
4412+
if (!this.hasCurrentKey || !comparerEquals) {
4413+
this.hasCurrentKey = true;
4414+
this.currentKey = key;
4415+
this.o.onNext(x);
4416+
}
4417+
};
4418+
DistinctUntilChangedObserver.prototype.error = function(e) {
44204419
this.o.onError(e);
4421-
}
4422-
};
4423-
DistinctUntilChangedObserver.prototype.onCompleted = function () {
4424-
if (!this.isStopped) {
4425-
this.isStopped = true;
4420+
};
4421+
DistinctUntilChangedObserver.prototype.completed = function () {
44264422
this.o.onCompleted();
4427-
}
4428-
};
4429-
DistinctUntilChangedObserver.prototype.dispose = function() { this.isStopped = true; };
4430-
DistinctUntilChangedObserver.prototype.fail = function (e) {
4431-
if (!this.isStopped) {
4432-
this.isStopped = true;
4433-
this.o.onError(e);
4434-
return true;
4435-
}
4423+
};
44364424

4437-
return false;
4438-
};
4425+
return DistinctUntilChangedObserver;
4426+
}(AbstractObserver));
44394427

44404428
/**
44414429
* Returns an observable sequence that contains only distinct contiguous elements according to the keyFn and the comparer.

dist/rx.all.compat.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.compat.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.js

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4243,54 +4243,42 @@ var FlatMapObservable = (function(__super__){
42434243
return DistinctUntilChangedObservable;
42444244
}(ObservableBase));
42454245

4246-
function DistinctUntilChangedObserver(o, keyFn, comparer) {
4247-
this.o = o;
4248-
this.keyFn = keyFn;
4249-
this.comparer = comparer;
4250-
this.hasCurrentKey = false;
4251-
this.currentKey = null;
4252-
this.isStopped = false;
4253-
}
4254-
4255-
DistinctUntilChangedObserver.prototype.onNext = function (x) {
4256-
if (this.isStopped) { return; }
4257-
var key = x;
4258-
if (isFunction(this.keyFn)) {
4259-
key = tryCatch(this.keyFn)(x);
4260-
if (key === errorObj) { return this.o.onError(key.e); }
4261-
}
4262-
if (this.hasCurrentKey) {
4263-
comparerEquals = tryCatch(this.comparer)(this.currentKey, key);
4264-
if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); }
4265-
}
4266-
if (!this.hasCurrentKey || !comparerEquals) {
4267-
this.hasCurrentKey = true;
4268-
this.currentKey = key;
4269-
this.o.onNext(x);
4246+
var DistinctUntilChangedObserver = (function(__super__) {
4247+
inherits(DistinctUntilChangedObserver, __super__);
4248+
function DistinctUntilChangedObserver(o, keyFn, comparer) {
4249+
this.o = o;
4250+
this.keyFn = keyFn;
4251+
this.comparer = comparer;
4252+
this.hasCurrentKey = false;
4253+
this.currentKey = null;
4254+
__super__.call(this);
42704255
}
4271-
};
4272-
DistinctUntilChangedObserver.prototype.onError = function(e) {
4273-
if (!this.isStopped) {
4274-
this.isStopped = true;
4256+
4257+
DistinctUntilChangedObserver.prototype.next = function (x) {
4258+
var key = x, comparerEquals;
4259+
if (isFunction(this.keyFn)) {
4260+
key = tryCatch(this.keyFn)(x);
4261+
if (key === errorObj) { return this.o.onError(key.e); }
4262+
}
4263+
if (this.hasCurrentKey) {
4264+
comparerEquals = tryCatch(this.comparer)(this.currentKey, key);
4265+
if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); }
4266+
}
4267+
if (!this.hasCurrentKey || !comparerEquals) {
4268+
this.hasCurrentKey = true;
4269+
this.currentKey = key;
4270+
this.o.onNext(x);
4271+
}
4272+
};
4273+
DistinctUntilChangedObserver.prototype.error = function(e) {
42754274
this.o.onError(e);
4276-
}
4277-
};
4278-
DistinctUntilChangedObserver.prototype.onCompleted = function () {
4279-
if (!this.isStopped) {
4280-
this.isStopped = true;
4275+
};
4276+
DistinctUntilChangedObserver.prototype.completed = function () {
42814277
this.o.onCompleted();
4282-
}
4283-
};
4284-
DistinctUntilChangedObserver.prototype.dispose = function() { this.isStopped = true; };
4285-
DistinctUntilChangedObserver.prototype.fail = function (e) {
4286-
if (!this.isStopped) {
4287-
this.isStopped = true;
4288-
this.o.onError(e);
4289-
return true;
4290-
}
4278+
};
42914279

4292-
return false;
4293-
};
4280+
return DistinctUntilChangedObserver;
4281+
}(AbstractObserver));
42944282

42954283
/**
42964284
* Returns an observable sequence that contains only distinct contiguous elements according to the keyFn and the comparer.

dist/rx.all.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.all.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.compat.js

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4302,54 +4302,42 @@ var FlatMapObservable = (function(__super__){
43024302
return DistinctUntilChangedObservable;
43034303
}(ObservableBase));
43044304

4305-
function DistinctUntilChangedObserver(o, keyFn, comparer) {
4306-
this.o = o;
4307-
this.keyFn = keyFn;
4308-
this.comparer = comparer;
4309-
this.hasCurrentKey = false;
4310-
this.currentKey = null;
4311-
this.isStopped = false;
4312-
}
4313-
4314-
DistinctUntilChangedObserver.prototype.onNext = function (x) {
4315-
if (this.isStopped) { return; }
4316-
var key = x;
4317-
if (isFunction(this.keyFn)) {
4318-
key = tryCatch(this.keyFn)(x);
4319-
if (key === errorObj) { return this.o.onError(key.e); }
4320-
}
4321-
if (this.hasCurrentKey) {
4322-
comparerEquals = tryCatch(this.comparer)(this.currentKey, key);
4323-
if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); }
4324-
}
4325-
if (!this.hasCurrentKey || !comparerEquals) {
4326-
this.hasCurrentKey = true;
4327-
this.currentKey = key;
4328-
this.o.onNext(x);
4305+
var DistinctUntilChangedObserver = (function(__super__) {
4306+
inherits(DistinctUntilChangedObserver, __super__);
4307+
function DistinctUntilChangedObserver(o, keyFn, comparer) {
4308+
this.o = o;
4309+
this.keyFn = keyFn;
4310+
this.comparer = comparer;
4311+
this.hasCurrentKey = false;
4312+
this.currentKey = null;
4313+
__super__.call(this);
43294314
}
4330-
};
4331-
DistinctUntilChangedObserver.prototype.onError = function(e) {
4332-
if (!this.isStopped) {
4333-
this.isStopped = true;
4315+
4316+
DistinctUntilChangedObserver.prototype.next = function (x) {
4317+
var key = x, comparerEquals;
4318+
if (isFunction(this.keyFn)) {
4319+
key = tryCatch(this.keyFn)(x);
4320+
if (key === errorObj) { return this.o.onError(key.e); }
4321+
}
4322+
if (this.hasCurrentKey) {
4323+
comparerEquals = tryCatch(this.comparer)(this.currentKey, key);
4324+
if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); }
4325+
}
4326+
if (!this.hasCurrentKey || !comparerEquals) {
4327+
this.hasCurrentKey = true;
4328+
this.currentKey = key;
4329+
this.o.onNext(x);
4330+
}
4331+
};
4332+
DistinctUntilChangedObserver.prototype.error = function(e) {
43344333
this.o.onError(e);
4335-
}
4336-
};
4337-
DistinctUntilChangedObserver.prototype.onCompleted = function () {
4338-
if (!this.isStopped) {
4339-
this.isStopped = true;
4334+
};
4335+
DistinctUntilChangedObserver.prototype.completed = function () {
43404336
this.o.onCompleted();
4341-
}
4342-
};
4343-
DistinctUntilChangedObserver.prototype.dispose = function() { this.isStopped = true; };
4344-
DistinctUntilChangedObserver.prototype.fail = function (e) {
4345-
if (!this.isStopped) {
4346-
this.isStopped = true;
4347-
this.o.onError(e);
4348-
return true;
4349-
}
4337+
};
43504338

4351-
return false;
4352-
};
4339+
return DistinctUntilChangedObserver;
4340+
}(AbstractObserver));
43534341

43544342
/**
43554343
* Returns an observable sequence that contains only distinct contiguous elements according to the keyFn and the comparer.

dist/rx.compat.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.compat.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rx.js

Lines changed: 32 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,54 +4111,42 @@ var FlatMapObservable = (function(__super__){
41114111
return DistinctUntilChangedObservable;
41124112
}(ObservableBase));
41134113

4114-
function DistinctUntilChangedObserver(o, keyFn, comparer) {
4115-
this.o = o;
4116-
this.keyFn = keyFn;
4117-
this.comparer = comparer;
4118-
this.hasCurrentKey = false;
4119-
this.currentKey = null;
4120-
this.isStopped = false;
4121-
}
4122-
4123-
DistinctUntilChangedObserver.prototype.onNext = function (x) {
4124-
if (this.isStopped) { return; }
4125-
var key = x;
4126-
if (isFunction(this.keyFn)) {
4127-
key = tryCatch(this.keyFn)(x);
4128-
if (key === errorObj) { return this.o.onError(key.e); }
4129-
}
4130-
if (this.hasCurrentKey) {
4131-
comparerEquals = tryCatch(this.comparer)(this.currentKey, key);
4132-
if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); }
4133-
}
4134-
if (!this.hasCurrentKey || !comparerEquals) {
4135-
this.hasCurrentKey = true;
4136-
this.currentKey = key;
4137-
this.o.onNext(x);
4114+
var DistinctUntilChangedObserver = (function(__super__) {
4115+
inherits(DistinctUntilChangedObserver, __super__);
4116+
function DistinctUntilChangedObserver(o, keyFn, comparer) {
4117+
this.o = o;
4118+
this.keyFn = keyFn;
4119+
this.comparer = comparer;
4120+
this.hasCurrentKey = false;
4121+
this.currentKey = null;
4122+
__super__.call(this);
41384123
}
4139-
};
4140-
DistinctUntilChangedObserver.prototype.onError = function(e) {
4141-
if (!this.isStopped) {
4142-
this.isStopped = true;
4124+
4125+
DistinctUntilChangedObserver.prototype.next = function (x) {
4126+
var key = x, comparerEquals;
4127+
if (isFunction(this.keyFn)) {
4128+
key = tryCatch(this.keyFn)(x);
4129+
if (key === errorObj) { return this.o.onError(key.e); }
4130+
}
4131+
if (this.hasCurrentKey) {
4132+
comparerEquals = tryCatch(this.comparer)(this.currentKey, key);
4133+
if (comparerEquals === errorObj) { return this.o.onError(comparerEquals.e); }
4134+
}
4135+
if (!this.hasCurrentKey || !comparerEquals) {
4136+
this.hasCurrentKey = true;
4137+
this.currentKey = key;
4138+
this.o.onNext(x);
4139+
}
4140+
};
4141+
DistinctUntilChangedObserver.prototype.error = function(e) {
41434142
this.o.onError(e);
4144-
}
4145-
};
4146-
DistinctUntilChangedObserver.prototype.onCompleted = function () {
4147-
if (!this.isStopped) {
4148-
this.isStopped = true;
4143+
};
4144+
DistinctUntilChangedObserver.prototype.completed = function () {
41494145
this.o.onCompleted();
4150-
}
4151-
};
4152-
DistinctUntilChangedObserver.prototype.dispose = function() { this.isStopped = true; };
4153-
DistinctUntilChangedObserver.prototype.fail = function (e) {
4154-
if (!this.isStopped) {
4155-
this.isStopped = true;
4156-
this.o.onError(e);
4157-
return true;
4158-
}
4146+
};
41594147

4160-
return false;
4161-
};
4148+
return DistinctUntilChangedObserver;
4149+
}(AbstractObserver));
41624150

41634151
/**
41644152
* Returns an observable sequence that contains only distinct contiguous elements according to the keyFn and the comparer.

0 commit comments

Comments
 (0)