3 ms·
May I ask why `window.resize` is used over `matchMedia`[0] to detect DPR changes? Is one approach better than the other? [0] https://developer.mozilla.org/en-U
by c_s_guy 5y ago
May I ask why `window.resize` is used over `matchMedia`[0] to detect DPR changes? Is one approach better than the other?
[0] https://developer.mozilla.org/en-US/docs/Web/API/Window/devicePixelRatio#monitoring_screen_resolution_or_zoom_level_changes https://developer.mozilla.org/en-US/docs/Web/API/Window/devi...
- ygra 5y agoThe resize event is compatible with IE < 10. Depending on compatibility guarantees this can be a reason.