(selector: string, entry: AnchorRegistryEntry)
| 45 | } |
| 46 | |
| 47 | function refreshEntry(selector: string, entry: AnchorRegistryEntry) { |
| 48 | const nextState = readAnchorsForSelector(selector) |
| 49 | const nextErrorMessage = nextState.error?.message ?? null |
| 50 | const previousErrorMessage = entry.error?.message ?? null |
| 51 | |
| 52 | if ( |
| 53 | areAnchorListsEqual(entry.anchors, nextState.anchors) && |
| 54 | nextErrorMessage === previousErrorMessage |
| 55 | ) { |
| 56 | return |
| 57 | } |
| 58 | |
| 59 | const nextEntry = { |
| 60 | ...entry, |
| 61 | anchors: nextState.anchors, |
| 62 | error: nextState.error, |
| 63 | } |
| 64 | |
| 65 | registry.set(selector, nextEntry) |
| 66 | notifySubscribers(nextEntry) |
| 67 | } |
| 68 | |
| 69 | function refreshAllEntries() { |
| 70 | registry.forEach((entry, selector) => { |
no test coverage detected