@samitouri / QOS-React-2 / commits / 6df050e726

Assign timeoutID to avoid multiple requests

Lucas Cordeiro committed Apr 18, 2019 at 06:46 UTC 6df050e726b324dff9d92af8712dccc0121b96dd
1 file changed +1 -1
src/devtools/views/Components/SelectedElement.js
+1 -1
@@ -320,7 +320,7 @@ function useInspectedElement(id: number | null): InspectedElement | null {
320 // Ask for an update in a second.
321 // Make sure we only ask once though.
322 clearTimeout(((timeoutID: any): TimeoutID));
323 - setTimeout(sendBridgeRequest, 1000);
323 + timeoutID = setTimeout(sendBridgeRequest, 1000);
324 };
325
326 bridge.addListener('inspectedElement', onInspectedElement);