We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a4e5965 commit b603cf6Copy full SHA for b603cf6
src/tests/windowMatchMedia/windowMatchMedia.ts
@@ -1,7 +1,9 @@
1
-export const windowMatchMedia = (matcher = 'onlyDesktop'): ((query: string) => MediaQueryList) => {
+export const windowMatchMedia = (
2
+ matcher: string | string[] = 'onlyDesktop'
3
+): ((query: string) => MediaQueryList) => {
4
return (query: string): MediaQueryList => {
5
return {
- matches: query === matcher,
6
+ matches: Array.isArray(matcher) ? matcher.includes(query) : matcher === query,
7
addListener: () => null,
8
removeListener: () => null,
9
media: '',
0 commit comments