GithubHelp home page GithubHelp logo

Comments (5)

IceCreamYou avatar IceCreamYou commented on August 21, 2024

Good catch. I think the simplest way to resolve this is to just reference requestAnimationFrame and cancelAnimationFrame in the global scope instead of as a property of root where the polyfill is defined. That will require a typeof check though to avoid a ReferenceError error if they don't exist. An alternative would be to get the actual global object like (0,eval)('this'), but I think that's overkill.

from mainloop.js.

IceCreamYou avatar IceCreamYou commented on August 21, 2024

Actually, just referencing in the global scope won't work currently because the names requestAnimationFrame and cancelAnimationFrame get initialized in local scope before we can reference them. We would need either an earlier reference or a different local name. Instead I will just check on the window object if it exists.

from mainloop.js.

IceCreamYou avatar IceCreamYou commented on August 21, 2024

@meeber Can you confirm this fix works? If so, I'll tag a new release so the fix can be pulled in more easily. Thanks!

from mainloop.js.

meeber avatar meeber commented on August 21, 2024

Confirmed: pure raf goodness with browserify. Thank you sir!

from mainloop.js.

IceCreamYou avatar IceCreamYou commented on August 21, 2024

1.0.3 released! Thanks for testing.

from mainloop.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.