File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ class FirstRetrySubscriber<T> extends Subscriber<T> {
23
23
constructor ( public destination : Subscriber < T > ,
24
24
private count : number ,
25
25
private source : Observable < T > ) {
26
- super ( null ) ;
26
+ super ( ) ;
27
+ destination . add ( this ) ;
27
28
this . lastSubscription = this ;
28
29
}
29
30
@@ -33,29 +34,23 @@ class FirstRetrySubscriber<T> extends Subscriber<T> {
33
34
34
35
error ( error ?) {
35
36
if ( ! this . isUnsubscribed ) {
36
- super . unsubscribe ( ) ;
37
+ this . unsubscribe ( ) ;
37
38
this . resubscribe ( ) ;
38
39
}
39
40
}
40
41
41
42
_complete ( ) {
42
- super . unsubscribe ( ) ;
43
+ this . unsubscribe ( ) ;
43
44
this . destination . complete ( ) ;
44
45
}
45
46
46
- unsubscribe ( ) {
47
- const lastSubscription = this . lastSubscription ;
48
- if ( lastSubscription === this ) {
49
- super . unsubscribe ( ) ;
50
- } else {
51
- lastSubscription . unsubscribe ( ) ;
52
- }
53
- }
54
-
55
47
resubscribe ( retried : number = 0 ) {
56
- this . lastSubscription . unsubscribe ( ) ;
48
+ const { lastSubscription, destination } = this ;
49
+ destination . remove ( lastSubscription ) ;
50
+ lastSubscription . unsubscribe ( ) ;
57
51
const nextSubscriber = new RetryMoreSubscriber ( this , this . count , retried + 1 ) ;
58
52
this . lastSubscription = this . source . subscribe ( nextSubscriber ) ;
53
+ destination . add ( this . lastSubscription ) ;
59
54
}
60
55
}
61
56
You can’t perform that action at this time.
0 commit comments