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(){
7171 var bacon = this . _bacon = this . _bacon || { } ;
7272 var unsubscribers = bacon . unsubscribers = bacon . unsubscribers || [ ] ;
7373 unsubscribers . push ( unsub ) ;
74+ return unsub ;
7475 } ,
7576 plug : function ( stream , stateKey ) {
7677 var unsubscribe ;
7778 var component = this ;
78- var bacon = this . _bacon = this . _bacon || { } ;
79- var unsubscribers = bacon . unsubscribers = bacon . unsubscribers || [ ] ;
80-
8179 if ( stateKey == null ) {
8280 unsubscribe = stream . onValue ( function ( partialState ) {
8381 component . setState ( partialState ) ;
@@ -89,8 +87,7 @@ module.exports.BaconMixin = ((function(){
8987 component . setState ( partialState ) ;
9088 } ) ;
9189 }
92- unsubscribers . push ( unsubscribe ) ;
93- return unsubscribe ;
90+ return this . subscribeTo ( unsubscribe ) ;
9491 } ,
9592 componentDidUpdate : function ( ) {
9693 var bacon = this . _bacon ;
@@ -118,7 +115,7 @@ module.exports.BaconMixin = ((function(){
118115
119116 var unsubscribers = bacon . unsubscribers ;
120117 if ( unsubscribers ) {
121- unsubscribers . forEach ( function ( f ) { f ( ) } ) ;
118+ unsubscribers . forEach ( function ( f ) { f ( ) ; } ) ;
122119 }
123120 }
124121 }
You can’t perform that action at this time.
0 commit comments