Closed RealOrangeOne closed 8 years ago
Window as a global doesnt exist when run under Node.JS. However, if run under something like jsdom, it does.
Window
jsdom
This PR allows window to be accessed if it exists, but stops anything breaking if it doesnt exist.
Should fix #69
@RealOrangeOne what about just using global, since any bundler that runs this code in the browser will use window for that.
global
window
if (global && global.cancelAnimationFrame) { ... }
LGTM
Window
as a global doesnt exist when run under Node.JS. However, if run under something likejsdom
, it does.This PR allows window to be accessed if it exists, but stops anything breaking if it doesnt exist.
Should fix #69