(entry: Entry)
| 5601 | } |
| 5602 | /** Quiet over a cold entry, and skips a state equal to a watcher's last. */ |
| 5603 | const emit = (entry: Entry): void => { |
| 5604 | if (entry.watchers.size === 0) return |
| 5605 | const server = view(entry) |
| 5606 | if (server._tag === "Initial") return |
| 5607 | const more = moreOf(entry) |
| 5608 | let patchedView: PatchedView | undefined |
| 5609 | for (const watcher of Array.from(entry.watchers)) { |
| 5610 | if (!watcher.active) continue |
| 5611 | if (watcher.provisional !== undefined) { |
| 5612 | // The withheld Failure, waiting or not: still withheld. |
| 5613 | if (watcher.provisional === entry.result) continue |
| 5614 | watcher.provisional = undefined |
| 5615 | } |
| 5616 | let result: AsyncResult.AsyncResult<any, any> = server |
| 5617 | let patched = false |
| 5618 | if (watcher.patched) { |
| 5619 | patchedView ??= patchedViewOf(entry, server) |
| 5620 | result = patchedView.result |
| 5621 | patched = patchedView.patched |
| 5622 | } |
| 5623 | if ( |
| 5624 | patched === watcher.lastPatched && sameMore(more, watcher.lastMore) && |
| 5625 | queryCore.sameResult(result, watcher.last) |
| 5626 | ) { |
| 5627 | continue |
| 5628 | } |
| 5629 | watcher.last = result |
| 5630 | watcher.lastPatched = patched |
| 5631 | watcher.lastMore = more |
| 5632 | watcher.onChange(result as Settled, patched, more) |
| 5633 | } |
| 5634 | } |
| 5635 | const emitFetch = ( |
| 5636 | entry: Entry, |
| 5637 | trigger: Trigger, |
no test coverage detected