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

Function getValue

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

Source from the content-addressed store, hash-verified

11 queries.map((q) => window.matchMedia(q));
12
13 const getValue = (mediaQueryLists: MediaQueryList[]) => {
14 const index = mediaQueryLists.findIndex((mql) => mql.matches);
15 return values?.[index] || defaultValue;
16 };
17
18 const [value, setValue] = useState<T>(() => {
19 if (afterHydration) {

Callers 2

useMediaFunction · 0.85
handlerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected