1.0.0 • Published 2 years ago
mediaquerylist.addeventlistener v1.0.0
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/mediaquerylist.addeventlistener@1.0.0/polyfill.js"></script>
LICENSE
MIT
1.0.0
2 years ago