@@ -19,7 +19,7 @@ class WindowTimeOperator<T, R> implements Operator<T, R> {
19
19
private scheduler : Scheduler ) {
20
20
}
21
21
22
- call ( subscriber : Subscriber < T > ) : Subscriber < T > {
22
+ call ( subscriber : Subscriber < Observable < T > > ) : Subscriber < T > {
23
23
return new WindowTimeSubscriber (
24
24
subscriber , this . windowTimeSpan , this . windowCreationInterval , this . scheduler
25
25
) ;
@@ -29,7 +29,7 @@ class WindowTimeOperator<T, R> implements Operator<T, R> {
29
29
class WindowTimeSubscriber < T > extends Subscriber < T > {
30
30
private windows : Subject < T > [ ] = [ ] ;
31
31
32
- constructor ( destination : Subscriber < T > ,
32
+ constructor ( protected destination : Subscriber < Observable < T > > ,
33
33
private windowTimeSpan : number ,
34
34
private windowCreationInterval : number ,
35
35
private scheduler : Scheduler ) {
@@ -72,9 +72,11 @@ class WindowTimeSubscriber<T> extends Subscriber<T> {
72
72
}
73
73
74
74
openWindow ( ) : Subject < T > {
75
- let window = new Subject < T > ( ) ;
75
+ const window = new Subject < T > ( ) ;
76
76
this . windows . push ( window ) ;
77
- this . destination . next ( window ) ;
77
+ const destination = this . destination ;
78
+ destination . add ( window ) ;
79
+ destination . next ( window ) ;
78
80
return window ;
79
81
}
80
82
0 commit comments