DoneJS StealJS jQuery ++ FuncUnit DocumentJS
3.0.0
2.3.27

 

  • Github
  • Twitter
  • Chat
  • Forum
  • Guides
  • Core
  • Ecosystem
    • can-construct-super
    • can-define-stream
    • can-fixture
    • can-fixture-socket
    • can-jquery
    • can-stache-converters
    • can-stream
    • can-vdom
    • can-view-import
    • can-zone
      • types
        • ZoneSpec
        • makeZoneSpec
      • static
        • current
        • error
        • ignore
        • waitFor
      • prototype
        • addWait
        • data
        • removeWait
        • run
      • plugins
        • ./debug
        • ./timeout
      • modules
        • ./register
    • steal-stache
  • Infrastructure
  • Legacy
  • Bitovi
    • Bitovi.com
    • Blog
    • Consulting
    • Training
    • Open Source
  • Chat
  • Forum
  • Star
  • Follow @canjs
  • CanJS
  • /
  • Ecosystem
  • /
  • can-zone
  • /
  • ./register
  • / On this page
    • can-zone/register

      module

      In order to do it's magic, can-zone has to register handlers for all of the common JavaScript async operations. If you have code (or a dependency with this code) that does:

      var st = setTimeout;
      

      And this module loads before can-zone, any time st is used we won't be able to track that within the Zone.

      To work around this, can-zone/register is used as a script that you run before any other modules.

      In Node

      require("can-zone/register");
      

      At the top of your entry-point script.

      In the Browser

      You can either add a script tag above all others:

      <script src="node_modules/can-zone/register.js"></script>
      

      Or, if you're using a module loader / bundler, configure it so that can-zone/register is placed above all others in the bundle.

      • source

      function()

      Returns

      {undefined}:

      CanJS is part of DoneJS. Created and maintained by the core DoneJS team and Bitovi. Currently 3.0.0.