wilsonpage / fastdom

Eliminates layout thrashing by batching DOM measurement and mutation tasks
6.83k stars 240 forks source link

fastdom.raf is always exported as setTimeout #88

Closed tempestwood closed 8 years ago

tempestwood commented 8 years ago

When required in browserify the value of win passed into the closure is an empty object, not window, thus fastdom.raf is implemented as setTimeout rather than requestAnimationFrame.

I've put a test case here: http://requirebin.com/?gist=tmpst/7d38bf287739be7d661be0f97fd83440

wilsonpage commented 8 years ago

Wow this is a great catch! I always though this === window in Browserify!

Much appreciated Sir.

wilsonpage commented 8 years ago

Fixed by https://github.com/wilsonpage/fastdom/commit/5614caa7cb6577810f836bb532098581f1283e42