ibm-js / delite

HTML Custom Element / Widget infrastructure
http://ibm-js.github.io/delite/
Other
68 stars 28 forks source link

Viewport: replace polling #504

Closed wkeese closed 5 years ago

wkeese commented 5 years ago

Replace polling in Viewport.js with listening to:

Removing polling should make it more responsive and also extend battery life on mobile devices (if I can remove polling from other places too).

wkeese commented 5 years ago

PS: Turns out I added the polling for mobile, in 52b21f964526549a301f60db59f30037233fe54e, but I'm not sure why. According to https://davidwalsh.name/orientation-change, monitoring for "resize" and "orientationchange" events should be sufficient. I'll have to test it though.