(url: string, entry: EntryState)
| 2181 | ) |
| 2182 | /** Writes the entry being left with its snapshot, so it survives a reload. A throw keeps the index only. */ |
| 2183 | const writeSnapshot = (url: string, entry: EntryState) => { |
| 2184 | // The current URL with the entry's snapshot: it supersedes a queued replace. |
| 2185 | queued = undefined |
| 2186 | try { |
| 2187 | history.replace(url, writeState(entry)) |
| 2188 | } catch (error) { |
| 2189 | replaceNow(url, writeState({ index: entry.index })) |
| 2190 | report( |
| 2191 | new SnapshotWriteFailed({ |
| 2192 | error, |
| 2193 | message: |
| 2194 | "[effect/ui] the Router couldn't write the saved state into history.state. It is kept in memory only, so a reload starts the entry fresh." |
| 2195 | }) |
| 2196 | ) |
| 2197 | } |
| 2198 | } |
| 2199 | // The mounted `Router.prefetch` declarations. |
| 2200 | const declarers = new Set<services.Declarer>() |
| 2201 | /** Calls `f` with every declaration covering the location's route, and the route in its union. */ |
no test coverage detected