First up, thanks for making this package!
I've discovered that it doesn't work in Safari 13 (and probably below): [Error] TypeError: mq.addEventListener is not a function.
Safari 13 uses an older, outdated syntax: mq.addListener(handleChange);
Whereas modern browsers use the later spec mq.addEventListener('change', handleChange);
(https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener)
You could give this a shot instead (although I haven't tested it):
try {
mq.addEventListener('change', handleChange);
} catch (err) {
// Safari
mq.addListener(handleChange);
}
First up, thanks for making this package!
I've discovered that it doesn't work in Safari 13 (and probably below):
[Error] TypeError: mq.addEventListener is not a function.Safari 13 uses an older, outdated syntax:
mq.addListener(handleChange);Whereas modern browsers use the later spec
mq.addEventListener('change', handleChange);(https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/addListener)
You could give this a shot instead (although I haven't tested it):