[#3789] Destroy mutable objects only if needed (#3799)

* [#3789] Don't observe objects if they are already mutable objects. Add some null checks.
* Don't destroy mutable in Selection.js if it wasn't created in that context.
* Remove * listeners and add null checks
* Don't delete _observers and _globalEventEmitters on $destroy. Pop all items off the _observers list for a mutable domain object.

Co-authored-by: Andrew Henry <akhenry@gmail.com>
This commit is contained in:
Shefali Joshi
2021-04-20 16:47:36 -07:00
committed by GitHub
parent 8157cdc7e9
commit 9fa71244ea
7 changed files with 43 additions and 30 deletions

View File

@ -222,11 +222,15 @@ define([
getColumnMapForObject(objectKeyString) {
let columns = this.configuration.getColumns();
return columns[objectKeyString].reduce((map, column) => {
map[column.getKey()] = column;
if (columns[objectKeyString]) {
return columns[objectKeyString].reduce((map, column) => {
map[column.getKey()] = column;
return map;
}, {});
return map;
}, {});
}
return {};
}
addColumnsForObject(telemetryObject) {