(type, state, action, nextActionId)
| 57 | } |
| 58 | |
| 59 | function 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 | |
| 82 | function dispatchRemotely(action) { |
| 83 | try { |
no outgoing calls
no test coverage detected