MCPcopy Create free account
hub / github.com/jhen0409/react-native-debugger / checkJSLoadCount

Function checkJSLoadCount

app/middlewares/debuggerAPI.js:117–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115
116let loadCount = 0
117const checkJSLoadCount = () => {
118 loadCount += 1
119 if (
120 currentWindow.webContents.isDevToolsOpened()
121 && config.timesJSLoadToRefreshDevTools >= 0
122 && loadCount > 0
123 && loadCount % config.timesJSLoadToRefreshDevTools === 0
124 ) {
125 currentWindow.webContents.closeDevTools()
126 currentWindow.webContents.openDevTools()
127 console.warn(
128 '[RNDebugger]',
129 `Refreshed the devtools panel as React Native app was reloaded ${loadCount} times.`,
130 'If you want to update or disable this,',
131 'Open `Debugger` -> `Open Config File` to change `timesJSLoadToRefreshDevTools` field.',
132 )
133 loadCount = 0
134 }
135}
136
137const connectToDebuggerProxy = async () => {
138 const ws = new WebSocket(`ws://${host}:${port}/debugger-proxy?role=debugger&name=Chrome`)

Callers 1

connectToDebuggerProxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected