(
entry: Entry,
stored: boolean,
defect: Cause.Cause<never> | undefined
)
| 6027 | } |
| 6028 | /** What ends every fetch, after its result is in: the defect and the emission, then the timers. */ |
| 6029 | const afterFetch = ( |
| 6030 | entry: Entry, |
| 6031 | stored: boolean, |
| 6032 | defect: Cause.Cause<never> | undefined |
| 6033 | ): void => { |
| 6034 | if (defect !== undefined) { |
| 6035 | for (const watcher of Array.from(entry.watchers)) { |
| 6036 | if (watcher.active) watcher.onDefect?.(defect) |
| 6037 | } |
| 6038 | } |
| 6039 | emit(entry) |
| 6040 | if (!stored) rearmInterval(entry) |
| 6041 | afterQuiet(entry) |
| 6042 | } |
| 6043 | /** |
| 6044 | * A fetch ended with nothing to store and nothing to restart it: the entry keeps its previous state, its |
| 6045 | * freshness included. Only a defect marks the previous Success stale. |
no test coverage detected