mirror of
https://github.com/nasa/openmct.git
synced 2025-02-20 17:33:23 +00:00
[API] track composition before notifying listeners
Track the updated composition of an object before notifying any listeners. Otherwise, any composition listener that mutates the object would cause an infinite loop. Detected in implementation of the new plot.
This commit is contained in:
parent
beaf8af2e8
commit
910d746002
@ -218,6 +218,8 @@ define([
|
||||
};
|
||||
}
|
||||
|
||||
listeners.composition = newComposition.map(objectUtils.parseKeyString);
|
||||
|
||||
added.forEach(function (addedChild) {
|
||||
listeners.add.forEach(notify(addedChild));
|
||||
});
|
||||
@ -226,7 +228,7 @@ define([
|
||||
listeners.remove.forEach(notify(removedChild));
|
||||
});
|
||||
|
||||
listeners.composition = newComposition.map(objectUtils.parseKeyString);
|
||||
|
||||
};
|
||||
|
||||
return DefaultCompositionProvider;
|
||||
|
Loading…
x
Reference in New Issue
Block a user