From e7b2eb3e0fccbbf08cc712ef31c66f1d91a7c04e Mon Sep 17 00:00:00 2001 From: Tetsuharu OHZEKI Date: Wed, 30 Dec 2015 16:30:27 +0900 Subject: [PATCH] refactor(subscriber): Make Subscriber's internal methods protected 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). --- src/InnerSubscriber.ts | 6 +++--- src/Subscriber.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/InnerSubscriber.ts b/src/InnerSubscriber.ts index 93331f483e..306443eb74 100644 --- a/src/InnerSubscriber.ts +++ b/src/InnerSubscriber.ts @@ -8,16 +8,16 @@ export class InnerSubscriber extends Subscriber { 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(); } diff --git a/src/Subscriber.ts b/src/Subscriber.ts index f9f9a272c5..7db085f767 100644 --- a/src/Subscriber.ts +++ b/src/Subscriber.ts @@ -63,16 +63,16 @@ export class Subscriber extends Subscription implements Observer { 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(); }