Invokes a callback with all node expansion keys.
(callback: (keys: K[]) => void)
| 1149 | |
| 1150 | /** Invokes a callback with all node expansion keys. */ |
| 1151 | private _forEachExpansionKey(callback: (keys: K[]) => void) { |
| 1152 | const toToggle: K[] = []; |
| 1153 | const observables: Observable<T[]>[] = []; |
| 1154 | |
| 1155 | this._nodes.value.forEach(node => { |
| 1156 | toToggle.push(this._getExpansionKey(node.data)); |
| 1157 | observables.push(this._getDescendants(node.data)); |
| 1158 | }); |
| 1159 | |
| 1160 | if (observables.length > 0) { |
| 1161 | combineLatest(observables) |
| 1162 | .pipe(take(1), takeUntil(this._onDestroy)) |
| 1163 | .subscribe(results => { |
| 1164 | results.forEach(inner => inner.forEach(r => toToggle.push(this._getExpansionKey(r)))); |
| 1165 | callback(toToggle); |
| 1166 | }); |
| 1167 | } else { |
| 1168 | callback(toToggle); |
| 1169 | } |
| 1170 | } |
| 1171 | |
| 1172 | /** Clears the maps we use to store parents, level & aria-sets in. */ |
| 1173 | private _clearPreviousCache() { |
no test coverage detected