(isOld: boolean, onlyGetId: boolean)
| 297 | } |
| 298 | |
| 299 | function createKeyGetter(isOld: boolean, onlyGetId: boolean) { |
| 300 | return function (diffItem: DiffItem): string { |
| 301 | const data = diffItem.data; |
| 302 | const dataIndex = diffItem.dataIndex; |
| 303 | // TODO if specified dim |
| 304 | if (onlyGetId) { |
| 305 | return data.getId(dataIndex); |
| 306 | } |
| 307 | if (isOld) { |
| 308 | return direction === TRANSITION_P2C ? diffItem.childGroupId : diffItem.groupId; |
| 309 | } |
| 310 | else { |
| 311 | return direction === TRANSITION_C2P ? diffItem.childGroupId : diffItem.groupId; |
| 312 | } |
| 313 | }; |
| 314 | } |
| 315 | |
| 316 | // Use id if it's very likely to be an one to one animation |
| 317 | // It's more robust than groupId |
no test coverage detected
searching dependent graphs…