| 42369 | |
| 42370 | |
| 42371 | function diffDataProps(props, oldProps) { |
| 42372 | if (oldProps === null) { |
| 42373 | return 'oldProps is null, initial diff'; |
| 42374 | } // Support optional app defined comparison of data |
| 42375 | |
| 42376 | |
| 42377 | var dataComparator = props.dataComparator; |
| 42378 | |
| 42379 | if (dataComparator) { |
| 42380 | if (!dataComparator(props.data, oldProps.data)) { |
| 42381 | return 'Data comparator detected a change'; |
| 42382 | } // Otherwise, do a shallow equal on props |
| 42383 | |
| 42384 | } else if (props.data !== oldProps.data) { |
| 42385 | return 'A new data container was supplied'; |
| 42386 | } |
| 42387 | |
| 42388 | return null; |
| 42389 | } // Checks if any update triggers have changed |
| 42390 | // also calls callback to invalidate attributes accordingly. |
| 42391 | |
| 42392 | |