Skip to content

Commit

Permalink
refactor(subscriber): Make Subscriber's internal methods protected
Browse files Browse the repository at this point in the history
This change make these members `protected`:

- `Subscriber._next()`
- `Subscriber._error()`
- `Subscriber._complete()`

At current codebase, these members is only used in drived class of
`Subscriber` or itself. Thus we should hide them from public.
(If we need to make them public, then we should make them so).
  • Loading branch information
tetsuharuohzeki authored and kwonoj committed Jan 11, 2016
1 parent 2dd771e commit e7b2eb3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/InnerSubscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ export class InnerSubscriber<T, R> extends Subscriber<R> {
super();
}

_next(value: R) {
protected _next(value: R) {
this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++);
}

_error(error: any) {
protected _error(error: any) {
this.parent.notifyError(error, this);
this.unsubscribe();
}

_complete() {
protected _complete() {
this.parent.notifyComplete(this);
this.unsubscribe();
}
Expand Down
6 changes: 3 additions & 3 deletions src/Subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ export class Subscriber<T> extends Subscription implements Observer<T> {
super.unsubscribe();
}

_next(value: T): void {
protected _next(value: T): void {
this.destination.next(value);
}

_error(err: any): void {
protected _error(err: any): void {
this.destination.error(err);
this.unsubscribe();
}

_complete(): void {
protected _complete(): void {
this.destination.complete();
this.unsubscribe();
}
Expand Down

0 comments on commit e7b2eb3

Please sign in to comment.