(payload, state, recordChanges)
| 91 | } |
| 92 | |
| 93 | function getInputHistoryState(payload, state, recordChanges) { |
| 94 | const {graphs, paths, layout} = state; |
| 95 | const {itempath, props} = payload; |
| 96 | const refProps = path(itempath.concat(['props']), layout) || {}; |
| 97 | const {id} = refProps; |
| 98 | |
| 99 | let historyEntry; |
| 100 | if (id) { |
| 101 | if (recordChanges) { |
| 102 | state.changed = {id, props}; |
| 103 | } |
| 104 | |
| 105 | historyEntry = {id, props: {}}; |
| 106 | keys(props).forEach(propKey => { |
| 107 | if (getCallbacksByInput(graphs, paths, id, propKey).length) { |
| 108 | historyEntry.props[propKey] = refProps[propKey]; |
| 109 | } |
| 110 | }); |
| 111 | } |
| 112 | return historyEntry; |
| 113 | } |
| 114 | |
| 115 | function recordHistory(reducer) { |
| 116 | return function (state, action) { |
no test coverage detected
searching dependent graphs…