https://github.com/cometkim/mediaquerylist.addeventlistener
A polyfill for MediaQueryList.prototype.addEventListener
https://github.com/cometkim/mediaquerylist.addeventlistener
Last synced: 11 months ago
JSON representation
A polyfill for MediaQueryList.prototype.addEventListener
- Host: GitHub
- URL: https://github.com/cometkim/mediaquerylist.addeventlistener
- Owner: cometkim
- License: mit
- Created: 2022-04-27T06:44:07.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-27T06:56:24.000Z (about 4 years ago)
- Last Synced: 2025-06-04T05:06:30.074Z (about 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MediaQueryList.prototype.addEventListener Polyfill
`MediaQueryList.prototype.addListener` and `MediaQueryList.prototype.removeListener` is deprecated and no longer recommended.
Instead, the standard supports it as same mechanism as `EventTarget.addEventListener`.
But [`MediaQueryList.prototype.addEventListener` is supported since Safari 14](https://caniuse.com/mdn-api_mediaquerylist), So we may still need polyfill to follow the standard :/
## Usage (via NPM)
```bash
yarn add mediaquerylist.addeventlistener
```
then import it from your entry script file.
```js
import 'mediaquerylist.addeventlistener/polyfill';
```
## Usage (via unpkg)
```html
```
## LICENSE
MIT