Skip to content

Commit

Permalink
fix use cases of Map
Browse files Browse the repository at this point in the history
  • Loading branch information
mondaychen committed Jun 6, 2022
1 parent 9a7e0be commit beb325f
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions packages/react-devtools-shared/src/backend/agent.js
Original file line number Diff line number Diff line change
Expand Up @@ -591,10 +591,8 @@ export default class Agent extends EventEmitter<{|

setTraceUpdatesEnabled(traceUpdatesEnabled);

for (const rendererID in this._rendererInterfaces) {
const renderer = ((this._rendererInterfaces[
(rendererID: any)
]: any): RendererInterface);
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
for (const renderer of this._rendererInterfaces.values()) {
renderer.setTraceUpdatesEnabled(traceUpdatesEnabled);
}
};
Expand All @@ -615,10 +613,8 @@ export default class Agent extends EventEmitter<{|
startProfiling = (recordChangeDescriptions: boolean) => {
this._recordChangeDescriptions = recordChangeDescriptions;
this._isProfiling = true;
for (const rendererID in this._rendererInterfaces) {
const renderer = ((this._rendererInterfaces[
(rendererID: any)
]: any): RendererInterface);
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
for (const renderer of this._rendererInterfaces.values()) {
renderer.startProfiling(recordChangeDescriptions);
}
this._bridge.send('profilingStatus', this._isProfiling);
Expand All @@ -627,10 +623,8 @@ export default class Agent extends EventEmitter<{|
stopProfiling = () => {
this._isProfiling = false;
this._recordChangeDescriptions = false;
for (const rendererID in this._rendererInterfaces) {
const renderer = ((this._rendererInterfaces[
(rendererID: any)
]: any): RendererInterface);
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
for (const renderer of this._rendererInterfaces.values()) {
renderer.stopProfiling();
}
this._bridge.send('profilingStatus', this._isProfiling);
Expand Down Expand Up @@ -672,10 +666,8 @@ export default class Agent extends EventEmitter<{|
};

updateComponentFilters = (componentFilters: Array<ComponentFilter>) => {
for (const rendererID in this._rendererInterfaces) {
const renderer = ((this._rendererInterfaces[
(rendererID: any)
]: any): RendererInterface);
// eslint-disable-next-line no-for-of-loops/no-for-of-loops
for (const renderer of this._rendererInterfaces.values()) {
renderer.updateComponentFilters(componentFilters);
}
};
Expand Down

0 comments on commit beb325f

Please sign in to comment.