Private propUpdater
propUpdater: any = _.debounce(() => {if (this.propsToUpdate && this.propsToUpdate.length) {const toUpdate = this.propsToUpdate.slice(0);this.propsToUpdate.length = 0;const final: powerbi.VisualObjectInstancesToPersist = {};let isSelection: boolean;toUpdate.forEach(n => {n.changes.forEach(m => {Object.keys(m).forEach(operation => {if (!final[operation]) {final[operation] = [];}final[operation].push(...m[operation]);});});if (n.selection) {isSelection = true;}});// SUPER important that these guys happen together, otherwise the selection does not update properlyif (isSelection) {this.host.onSelect({ data: [] } as any); // TODO: Change this to visualObjects: []?}this.host.persistProperties(final);}}, this.delay)
A class that provides a way to easily persist multiple objects at the same time without multiple calls to host.persistProperties