When calling Assign(), listeners get notified of a ComponentAdded event after the exchange() happens but before the component gets copied. This means that if that component gets fetched in the listener it will be a "zero" component.
The changes in this PR ensure that components are copied before notifying listeners. It splits the internal exchange() function into exchange(), exchangeNoNotify() and notifyExchange(). This allows us to perform the copyTo() in the Assign() before notifying the listeners.
When calling
Assign()
, listeners get notified of aComponentAdded
event after theexchange()
happens but before the component gets copied. This means that if that component gets fetched in the listener it will be a "zero" component.The changes in this PR ensure that components are copied before notifying listeners. It splits the internal
exchange()
function intoexchange()
,exchangeNoNotify()
andnotifyExchange()
. This allows us to perform thecopyTo()
in theAssign()
before notifying the listeners.