File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ var ReactFireMixin = {
55 /* Initializes the Firebase binding refs array */
66 componentWillMount : function ( ) {
77 this . firebaseRefs = { } ;
8+ this . firebaseListeners = { } ;
89 } ,
910
1011 /* Removes any remaining Firebase bindings */
@@ -47,7 +48,7 @@ var ReactFireMixin = {
4748 }
4849
4950 this . firebaseRefs [ bindVar ] = firebaseRef . ref ( ) ;
50- firebaseRef . on ( "value" , function ( dataSnapshot ) {
51+ this . firebaseListeners [ bindVar ] = firebaseRef . on ( "value" , function ( dataSnapshot ) {
5152 var newState = { } ;
5253 if ( bindAsArray ) {
5354 newState [ bindVar ] = this . _toArray ( dataSnapshot . val ( ) ) ;
@@ -67,8 +68,9 @@ var ReactFireMixin = {
6768 throw new Error ( "unexpected value for bindVar. \"" + bindVar + "\" was either never bound or has already been unbound" ) ;
6869 }
6970
70- this . firebaseRefs [ bindVar ] . off ( "value" ) ;
71+ this . firebaseRefs [ bindVar ] . off ( "value" , this . firebaseListeners [ bindVar ] ) ;
7172 delete this . firebaseRefs [ bindVar ] ;
73+ delete this . firebaseListeners [ bindVar ] ;
7274 } ,
7375
7476
@@ -122,4 +124,4 @@ var ReactFireMixin = {
122124 }
123125 return out ;
124126 }
125- } ;
127+ } ;
You can’t perform that action at this time.
0 commit comments