Skip to content

Commit

Permalink
style(lint): fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
benlesh committed May 22, 2016
1 parent a5f50f3 commit 55d5141
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 25 deletions.
1 change: 0 additions & 1 deletion spec/subjects/ReplaySubject-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ describe('ReplaySubject', () => {
it('should be an Observer which can be given to Observable.subscribe', () => {
const source = Observable.of(1, 2, 3, 4, 5);
const subject = new ReplaySubject(3);
const expected = [3, 4, 5];
let results = [];

subject.subscribe(x => results.push(x), null, () => results.push('done'));
Expand Down
2 changes: 1 addition & 1 deletion src/ReplaySubject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {queue} from './scheduler/queue';
import {Subscriber} from './Subscriber';
import {Subscription} from './Subscription';
import {ObserveOnSubscriber} from './operator/observeOn';
import {SubjectSubscription} from './SubjectSubscription';

/**
* @class ReplaySubject<T>
*/
Expand Down
36 changes: 16 additions & 20 deletions src/Subject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,34 +52,30 @@ export class Subject<T> extends Observable<T> implements ISubscription {
if (this.isUnsubscribed) {
throw new ObjectUnsubscribedError();
}
if (!this.isStopped) {
this.hasError = true;
this.thrownError = err;
this.isStopped = true;
const { observers } = this;
const len = observers.length;
const copy = observers.slice();
for (let i = 0; i < len; i++) {
copy[i].error(err);
}
this.observers.length = 0;
this.hasError = true;
this.thrownError = err;
this.isStopped = true;
const { observers } = this;
const len = observers.length;
const copy = observers.slice();
for (let i = 0; i < len; i++) {
copy[i].error(err);
}
this.observers.length = 0;
}

complete() {
if (this.isUnsubscribed) {
throw new ObjectUnsubscribedError();
}
if (!this.isStopped) {
this.isStopped = true;
const { observers } = this;
const len = observers.length;
const copy = observers.slice();
for (let i = 0; i < len; i++) {
copy[i].complete();
}
this.observers.length = 0;
this.isStopped = true;
const { observers } = this;
const len = observers.length;
const copy = observers.slice();
for (let i = 0; i < len; i++) {
copy[i].complete();
}
this.observers.length = 0;
}

unsubscribe() {
Expand Down
1 change: 0 additions & 1 deletion src/observable/dom/WebSocketSubject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ export class WebSocketSubject<T> extends AnonymousSubject<T> {
err => observer.error(err),
() => observer.complete());


return () => {
const result = tryCatch(unsubMsg)();
if (result === errorObject) {
Expand Down
1 change: 0 additions & 1 deletion src/operator/groupBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ class GroupBySubscriber<T, K, R> extends Subscriber<T> implements RefCountSubscr
}

let group = groups.get(key);
let groupEmitted = false;

let element: R;
if (this.elementSelector) {
Expand Down
1 change: 0 additions & 1 deletion src/util/toSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export function toSubscriber<T>(
return new Subscriber(nextOrObserver, error, complete);
}


export class SubjectSubscriber<T> extends Subscriber<T> {
constructor(protected destination: Subject<T>) {
super(destination);
Expand Down

0 comments on commit 55d5141

Please sign in to comment.