MCPcopy Create free account
hub / github.com/dailydotdev/apps / getValue

Function getValue

packages/shared/src/hooks/useMedia.ts:24–27  ·  view source on GitHub ↗
(mediaQueryLists: MediaQueryList[])

Source from the content-addressed store, hash-verified

22 queries.map((q) => window.matchMedia(q));
23
24 const getValue = (mediaQueryLists: MediaQueryList[]) => {
25 const index = mediaQueryLists.findIndex((mql) => mql.matches);
26 return values?.[index] || defaultValue;
27 };
28
29 const [value, setValue] = useState<T>(() => {
30 if (afterHydration && !hydrated) {

Callers 2

useMediaFunction · 0.70
handlerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected