mediaquerylist.addeventlistener
v1.0.0
Published
`MediaQueryList.prototype.addListener` and `MediaQueryList.prototype.removeListener` is deprecated and no longer recommended.
Downloads
9
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, So we may still need polyfill to follow the standard :/
Usage (via NPM)
yarn add mediaquerylist.addeventlistener
then import it from your entry script file.
import 'mediaquerylist.addeventlistener/polyfill';
Usage (via unpkg)
<script src="https://unpkg.com/[email protected]/polyfill.js"></script>
LICENSE
MIT