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

Function workerOnMessage

app/middlewares/debuggerAPI.js:34–52  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

32const APOLLO_MESSAGE_PREFIX = 'ac-devtools:'
33
34const workerOnMessage = (message) => {
35 const { data } = message
36
37 if (data && data.message?.startsWith(APOLLO_MESSAGE_PREFIX)) {
38 data.__FROM_DEBUGGER_WORKER__ = true
39 postMessage(data, '*')
40 return false
41 }
42
43 if (data && (data.__IS_REDUX_NATIVE_MESSAGE__ || data.__REPORT_REACT_DEVTOOLS_PORT__)) {
44 return true
45 }
46 const list = data && data.__AVAILABLE_METHODS_CAN_CALL_BY_RNDEBUGGER__
47 if (list) {
48 setDevMenuMethods(list, worker)
49 return false
50 }
51 socket.send(JSON.stringify(data))
52}
53
54const onWindowMessage = (e) => {
55 const { data } = e

Callers

nothing calls this directly

Calls 1

setDevMenuMethodsFunction · 0.90

Tested by

no test coverage detected