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

Function handleMessages

app/worker/reduxAPI.js:160–196  ·  view source on GitHub ↗
(message)

Source from the content-addressed store, hash-verified

158}
159
160function handleMessages(message) {
161 const {
162 id, instanceId, type, action, state, toAll,
163 } = message
164 if (toAll) {
165 Object.keys(instances).forEach((key) => {
166 handleMessages({ ...message, id: key, toAll: false })
167 })
168 return false
169 }
170
171 const instance = instances[id || instanceId]
172 if (!instance) return true
173 const { store, filters } = instance
174 if (!store) return false
175
176 switch (type) {
177 case 'DISPATCH':
178 store.liftedStore.dispatch(action)
179 break
180 case 'ACTION':
181 dispatchRemotely(action, instance)
182 break
183 case 'IMPORT':
184 importPayloadFrom(store, state, instance)
185 break
186 case 'EXPORT':
187 exportState(instance)
188 break
189 case 'UPDATE':
190 relay('STATE', getLiftedState(store, filters), instance)
191 break
192 default:
193 break
194 }
195 return false
196}
197
198function start(instance) {
199 if (!listenerAdded) {

Callers 1

startFunction · 0.70

Calls 5

dispatchRemotelyFunction · 0.85
importPayloadFromFunction · 0.85
exportStateFunction · 0.85
relayFunction · 0.85
getLiftedStateFunction · 0.85

Tested by

no test coverage detected