FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
uniswap_interface_sc/apps/web/src/utils/matchMedia.ts at main · stringcode86/uniswap_interface_sc · GitHub
stringcode86
uniswap_interface_sc
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
uniswap_interface_sc
/
apps
/
web
/
src
/
utils
/
matchMedia.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (16 loc) · 644 Bytes
Breadcrumbs
uniswap_interface_sc
/
apps
/
web
/
src
/
utils
/
matchMedia.ts
Copy path
File metadata and controls
18 lines (16 loc) · 644 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Need to fallback to support older browsers (mainly, Safari < 14).
// See: https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#browser_compatibility
export
function
addMediaQueryListener
(
mediaQuery
:
MediaQueryList
,
listener
:
(
event
:
MediaQueryListEvent
)
=>
void
)
{
try
{
mediaQuery
.
addEventListener
(
'change'
,
listener
)
}
catch
(
e
)
{
mediaQuery
.
addListener
(
listener
)
}
}
export
function
removeMediaQueryListener
(
mediaQuery
:
MediaQueryList
,
listener
:
(
event
:
MediaQueryListEvent
)
=>
void
)
{
try
{
mediaQuery
.
removeEventListener
(
'change'
,
listener
)
}
catch
(
e
)
{
mediaQuery
.
removeListener
(
listener
)
}
}
Back
|
FazBrowse Home
|
New Git URL