(componentPath: DashLayoutPath)
| 82 | |
| 83 | export const selectDashProps = |
| 84 | (componentPath: DashLayoutPath) => |
| 85 | (state: any): SelectDashProps => { |
| 86 | const c = getComponentLayout(componentPath, state); |
| 87 | // Layout hashes records the number of times a path has been updated. |
| 88 | // sum with the parents hash (match without the last ']') to get the real hash |
| 89 | // Then it can be easily compared without having to compare the props. |
| 90 | const strPath = stringifyPath(componentPath); |
| 91 | |
| 92 | let hash; |
| 93 | if (checkDashChildrenUpdate(c)) { |
| 94 | hash = determineChangedProps(state, strPath); |
| 95 | } else { |
| 96 | hash = state.layoutHashes[strPath]; |
| 97 | } |
| 98 | let h = 0; |
| 99 | let changedProps: object = {}; |
| 100 | let renderType = ''; |
| 101 | if (hash) { |
| 102 | h = hash['hash']; |
| 103 | changedProps = hash['changedProps']; |
| 104 | renderType = hash['renderType']; |
| 105 | } |
| 106 | return [c, c?.props, h, changedProps, renderType]; |
| 107 | }; |
| 108 | |
| 109 | export function selectDashPropsEqualityFn( |
| 110 | [_, __, hash]: SelectDashProps, |
no test coverage detected
searching dependent graphs…