File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -71,13 +71,11 @@ module.exports.BaconMixin = ((function(){
71
71
var bacon = this . _bacon = this . _bacon || { } ;
72
72
var unsubscribers = bacon . unsubscribers = bacon . unsubscribers || [ ] ;
73
73
unsubscribers . push ( unsub ) ;
74
+ return unsub ;
74
75
} ,
75
76
plug : function ( stream , stateKey ) {
76
77
var unsubscribe ;
77
78
var component = this ;
78
- var bacon = this . _bacon = this . _bacon || { } ;
79
- var unsubscribers = bacon . unsubscribers = bacon . unsubscribers || [ ] ;
80
-
81
79
if ( stateKey == null ) {
82
80
unsubscribe = stream . onValue ( function ( partialState ) {
83
81
component . setState ( partialState ) ;
@@ -89,8 +87,7 @@ module.exports.BaconMixin = ((function(){
89
87
component . setState ( partialState ) ;
90
88
} ) ;
91
89
}
92
- unsubscribers . push ( unsubscribe ) ;
93
- return unsubscribe ;
90
+ return this . subscribeTo ( unsubscribe ) ;
94
91
} ,
95
92
componentDidUpdate : function ( ) {
96
93
var bacon = this . _bacon ;
@@ -118,7 +115,7 @@ module.exports.BaconMixin = ((function(){
118
115
119
116
var unsubscribers = bacon . unsubscribers ;
120
117
if ( unsubscribers ) {
121
- unsubscribers . forEach ( function ( f ) { f ( ) } ) ;
118
+ unsubscribers . forEach ( function ( f ) { f ( ) ; } ) ;
122
119
}
123
120
}
124
121
}
You can’t perform that action at this time.
0 commit comments