Skip to content

Commit 64ba901

Browse files
committed
fix(Subject): make value parameter for next non-optional
Prevents emitting undefined on strictly-typed Subjects BREAKING CHANGE: If you are using TypeScript called next() without a value before, TypeScript will error. If the Subject is of type void, explicitely pass undefined to next(). closes ReactiveX#2852
1 parent cd9626a commit 64ba901

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Subject.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class Subject<T> extends Observable<T> implements ISubscription {
4949
return <any>subject;
5050
}
5151

52-
next(value?: T) {
52+
next(value: T) {
5353
if (this.closed) {
5454
throw new ObjectUnsubscribedError();
5555
}

src/operators/repeatWhen.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class RepeatWhenOperator<T> implements Operator<T, T> {
4646
*/
4747
class RepeatWhenSubscriber<T, R> extends OuterSubscriber<T, R> {
4848

49-
private notifications: Subject<any>;
49+
private notifications: Subject<void>;
5050
private retries: Observable<any>;
5151
private retriesSubscription: Subscription;
5252
private sourceIsBeingSubscribedTo: boolean = true;
@@ -81,7 +81,7 @@ class RepeatWhenSubscriber<T, R> extends OuterSubscriber<T, R> {
8181
}
8282

8383
this._unsubscribeAndRecycle();
84-
this.notifications.next();
84+
this.notifications.next(undefined);
8585
}
8686
}
8787

0 commit comments

Comments
 (0)