This repository was archived by the owner on May 19, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -173,12 +173,13 @@ export function _createProperty(initValue) {
173
173
prop . addChangeListener = toProp . addChangeListener ;
174
174
prop . emitChange = toProp . emitChange ;
175
175
_each ( emitter . listeners ( 'change' ) , cb => toProp . addChangeListener ( cb ) ) ;
176
- emitter = null ;
176
+ emitter = toProp . __emitter ;
177
177
store = null ;
178
178
} ;
179
179
180
180
prop . version = ++ _propertyVersionId ;
181
181
prop . isProperty = true ;
182
+ prop . __emitter = emitter ;
182
183
return prop ;
183
184
}
184
185
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ describe('Utils', function () {
111
111
var cb = sinon . spy ( ) ;
112
112
const propA = utils . _createProperty ( 'val' ) ;
113
113
const toPropB = utils . _createProperty ( 'val2' ) ;
114
- propA . addChangeListener ( cb ) ;
114
+ const stopper = propA . addChangeListener ( cb ) ;
115
115
propA . proxyTo ( toPropB ) ;
116
116
propA ( ) . should . be . equal ( 'val2' ) ;
117
117
toPropB ( ) . should . be . equal ( 'val2' ) ;
@@ -122,6 +122,10 @@ describe('Utils', function () {
122
122
toPropB ( 'val3' ) ;
123
123
cb . should . have . callCount ( 1 ) ;
124
124
toPropB ( ) . should . be . equal ( 'val3' ) ;
125
+ stopper ( ) ;
126
+ toPropB ( 'val4' ) ;
127
+ cb . should . have . callCount ( 1 ) ;
128
+ toPropB ( ) . should . be . equal ( 'val4' ) ;
125
129
} ) ;
126
130
} ) ;
127
131
You can’t perform that action at this time.
0 commit comments