(
prevRoots: Node[],
{removed, updated, partial}: debug.StructureUpdates,
)
| 254 | } |
| 255 | |
| 256 | export function reconcileStructure( |
| 257 | prevRoots: Node[], |
| 258 | {removed, updated, partial}: debug.StructureUpdates, |
| 259 | ): State { |
| 260 | Updated = updated |
| 261 | NewNodeList = [] |
| 262 | const nextRoots: Node[] = [] |
| 263 | |
| 264 | const upatedTopLevelRoots = new Set<debug.NodeID>() |
| 265 | for (const root of prevRoots) { |
| 266 | const {id} = root |
| 267 | // skip removed roots for partial updates |
| 268 | // and for full updates skip roots that were not sent |
| 269 | if (partial ? removed.includes(id) : !(id in Updated)) continue |
| 270 | upatedTopLevelRoots.add(id) |
| 271 | nextRoots.push(updateNode(root, id, Updated[id]?.[id], 0)) |
| 272 | } |
| 273 | |
| 274 | for (const [rootId, updatedNodes] of entries(Updated)) { |
| 275 | const root = updatedNodes![rootId] |
| 276 | if (!root || upatedTopLevelRoots.has(rootId)) continue |
| 277 | nextRoots.push(createNode(root, null, 0)) |
| 278 | } |
| 279 | |
| 280 | return {roots: nextRoots, nodeList: NewNodeList} |
| 281 | } |
| 282 | |
| 283 | export const path_height = theme.spacing[4.5] |
| 284 | export const row_height = theme.spacing[4.5] |
no test coverage detected
searching dependent graphs…