What about on dom ready? Shouldn't the "test" be ran then too?
jfrux opened this issue · 2 comments
jfrux commented
I think it would be cool if we could trigger it on dom ready as well... for setting up things based on a particular width or whatever
knightdr commented
@joshuairl
Sorry for delay. I answered this question but my comment seemed to have not been saved.
Since this is a polyfill for native matchMedia, I think the initial test for availability of matchMedia should be run asap.
If you want to wrap a media query test like matchMedia('(min-width: 800px)') in a dom ready function, go for it.
What is the use case you have in mind?
knightdr commented
Closing due to lack of response and question seems to be answered.