Skip to content

Commit

Permalink
Merge pull request facebook#175 from lucasecdb/assign-timeout
Browse files Browse the repository at this point in the history
Assign timeoutID to avoid multiple requests
  • Loading branch information
Brian Vaughn committed Apr 18, 2019
2 parents 0d932d7 + 6df050e commit d995f19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/devtools/views/Components/SelectedElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ function useInspectedElement(id: number | null): InspectedElement | null {
// Ask for an update in a second.
// Make sure we only ask once though.
clearTimeout(((timeoutID: any): TimeoutID));
setTimeout(sendBridgeRequest, 1000);
timeoutID = setTimeout(sendBridgeRequest, 1000);
};

bridge.addListener('inspectedElement', onInspectedElement);
Expand Down

0 comments on commit d995f19

Please sign in to comment.