Skip to content

Commit b603cf6

Browse files
author
Kubit
committed
Update windowMatchMedia hook
1 parent a4e5965 commit b603cf6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tests/windowMatchMedia/windowMatchMedia.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
export const windowMatchMedia = (matcher = 'onlyDesktop'): ((query: string) => MediaQueryList) => {
1+
export const windowMatchMedia = (
2+
matcher: string | string[] = 'onlyDesktop'
3+
): ((query: string) => MediaQueryList) => {
24
return (query: string): MediaQueryList => {
35
return {
4-
matches: query === matcher,
6+
matches: Array.isArray(matcher) ? matcher.includes(query) : matcher === query,
57
addListener: () => null,
68
removeListener: () => null,
79
media: '',

0 commit comments

Comments
 (0)