MCPcopy
hub / github.com/vuejs/core / hydrateOnMediaQuery

Function hydrateOnMediaQuery

packages/runtime-core/src/hydrationStrategies.ts:70–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68
69export const hydrateOnMediaQuery: HydrationStrategyFactory<string> =
70 query => hydrate => {
71 if (query) {
72 const mql = matchMedia(query)
73 if (mql.matches) {
74 hydrate()
75 } else {
76 mql.addEventListener('change', hydrate, { once: true })
77 return () => mql.removeEventListener('change', hydrate)
78 }
79 }
80 }
81
82export const hydrateOnInteraction: HydrationStrategyFactory<
83 keyof HTMLElementEventMap | Array<keyof HTMLElementEventMap>

Callers

nothing calls this directly

Calls 1

hydrateFunction · 0.85

Tested by

no test coverage detected