(input, hydrateOptions)
| 7093 | } |
| 7094 | } |
| 7095 | const hydrate: CacheInternals["hydrate"] = (input, hydrateOptions) => { |
| 7096 | if (disposed) return |
| 7097 | const parsed = parseRaw(input) |
| 7098 | if (parsed === undefined) { |
| 7099 | report( |
| 7100 | new HydrationMalformed({ |
| 7101 | message: "[Query] the ~query state isn't the tuple shape. It was ignored." |
| 7102 | }) |
| 7103 | ) |
| 7104 | return |
| 7105 | } |
| 7106 | hydratedAt = hydrateOptions?.at ?? now() |
| 7107 | hydratedStatic = hydrateOptions?.static === true |
| 7108 | hydrateDecode = hydrateOptions?.decodeSuccess |
| 7109 | windowOpen = !hydratedStatic |
| 7110 | adopting = true |
| 7111 | raw = parsed |
| 7112 | // Reads the cache has already seen decode at once. |
| 7113 | for (const name of Array.from(raw.keys())) { |
| 7114 | const def = queries.get(name) |
| 7115 | if (def !== undefined) decodeRaw(def) |
| 7116 | } |
| 7117 | } |
| 7118 | const closeWindow = (): void => { |
| 7119 | adopting = false |
| 7120 | // An entry made while the page was adopted gets its saved value now: as its |
no test coverage detected