MCPcopy
hub / github.com/zalmoxisus/remote-redux-devtools / relay

Function relay

src/devTools.js:59–80  ·  view source on GitHub ↗
(type, state, action, nextActionId)

Source from the content-addressed store, hash-verified

57}
58
59function relay(type, state, action, nextActionId) {
60 if (isFiltered(action, filters)) return;
61 const message = {
62 type,
63 id: socket.id,
64 name: instanceName
65 };
66 if (state) {
67 message.payload = type === 'ERROR' ? state :
68 stringify(filterState(state, type, filters, stateSanitizer, actionSanitizer, nextActionId));
69 }
70 if (type === 'ACTION') {
71 message.action = stringify(
72 !actionSanitizer ? action : actionSanitizer(action.action, nextActionId - 1)
73 );
74 message.isExcess = isExcess;
75 message.nextActionId = nextActionId;
76 } else if (action) {
77 message.action = action;
78 }
79 socket.emit(socket.id ? 'log' : 'log-noid', message);
80}
81
82function dispatchRemotely(action) {
83 try {

Callers 5

dispatchRemotelyFunction · 0.85
handleMessagesFunction · 0.85
loginFunction · 0.85
checkForReducerErrorsFunction · 0.85
handleChangeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected