File tree 1 file changed +12
-8
lines changed
1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -32,15 +32,17 @@ class ActiveChannel {
32
32
33
33
unsubscribe ( subscription ) {
34
34
const index = ArrayPrototypeIndexOf ( this . _subscribers , subscription ) ;
35
- if ( index >= 0 ) {
36
- ArrayPrototypeSplice ( this . _subscribers , index , 1 ) ;
35
+ if ( index === - 1 ) return false ;
37
36
38
- // When there are no more active subscribers, restore to fast prototype.
39
- if ( ! this . _subscribers . length ) {
40
- // eslint-disable-next-line no-use-before-define
41
- ObjectSetPrototypeOf ( this , Channel . prototype ) ;
42
- }
37
+ ArrayPrototypeSplice ( this . _subscribers , index , 1 ) ;
38
+
39
+ // When there are no more active subscribers, restore to fast prototype.
40
+ if ( ! this . _subscribers . length ) {
41
+ // eslint-disable-next-line no-use-before-define
42
+ ObjectSetPrototypeOf ( this , Channel . prototype ) ;
43
43
}
44
+
45
+ return true ;
44
46
}
45
47
46
48
get hasSubscribers ( ) {
@@ -79,7 +81,9 @@ class Channel {
79
81
this . subscribe ( subscription ) ;
80
82
}
81
83
82
- unsubscribe ( ) { }
84
+ unsubscribe ( ) {
85
+ return false ;
86
+ }
83
87
84
88
get hasSubscribers ( ) {
85
89
return false ;
You can’t perform that action at this time.
0 commit comments