From 75dc42f4dfe408e6559f0808f3694404300a589a Mon Sep 17 00:00:00 2001 From: Edmond Chui Date: Thu, 9 May 2024 03:43:38 -0700 Subject: [PATCH] extract param type (#44498) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/44498 Changelog: [internal] Quick refactor to reduce commit noise in the following diff in the stack Reviewed By: blakef Differential Revision: D57140480 fbshipit-source-id: aa1fef83d5347b8a11651d3d5c4112b4adf7a7d5 --- .../src/inspector-proxy/DeviceEventReporter.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/dev-middleware/src/inspector-proxy/DeviceEventReporter.js b/packages/dev-middleware/src/inspector-proxy/DeviceEventReporter.js index 79c8aa16604..5fe9b4bc83d 100644 --- a/packages/dev-middleware/src/inspector-proxy/DeviceEventReporter.js +++ b/packages/dev-middleware/src/inspector-proxy/DeviceEventReporter.js @@ -31,6 +31,11 @@ type RequestMetadata = $ReadOnly<{ frontendUserAgent: string | null, }>; +type ResponseMetadata = $ReadOnly<{ + pageId: string | null, + frontendUserAgent: string | null, +}>; + class DeviceEventReporter { #eventReporter: EventReporter; @@ -72,10 +77,7 @@ class DeviceEventReporter { logResponse( res: CDPResponse<>, origin: 'device' | 'proxy', - metadata: $ReadOnly<{ - pageId: string | null, - frontendUserAgent: string | null, - }>, + metadata: ResponseMetadata, ): void { const pendingCommand = this.#pendingCommands.get(res.id); if (!pendingCommand) {