polyfill/require.js
function requireLazy(dependencies, factory, context) {
    return define(
      dependencies,
      factory,
      undefined,
      REQUIRE_WHEN_READY,
      context,
      1
    );
  }
function requireLazy(dependencies, factory, context) {
    return define(
      dependencies,
      factory,
      undefined,
      REQUIRE_WHEN_READY,
      context,
      1
    );
  }
function requireLazy ( dependencies , factory , context ) { return define ( dependencies , factory , undefined , REQUIRE_WHEN_READY , context , 1 ) ; }
Special version of define that executes the factory as soon as all
dependencies are met.

define() does just that, defines a module. Module's factory will not be
called until required by other module. This makes sense for most of our
library modules: we do not want to execute the factory unless it's being
used by someone.

On the other hand there are modules, that you can call "entrance points".
You want to run the "factory" method for them as soon as all dependencies
are met.

@example

define('BaseClass', [], function() { return ... });
// ^^ factory for BaseClass was just stored in modulesMap

define('SubClass', ['BaseClass'], function() { ... });
// SubClass module is marked as ready (waiting == 0), factory is just
// stored

define('OtherClass, ['BaseClass'], function() { ... });
// OtherClass module is marked as ready (waiting == 0), factory is just
// stored

requireLazy(['SubClass', 'ChatConfig'],
function() { ... });
// ChatRunner is waiting for ChatConfig to come

define('ChatConfig', [], { foo: 'bar' });
// at this point ChatRunner is marked as ready, and its factory
// executed + all dependent factories are executed too: BaseClass,
// SubClass, ChatConfig notice that OtherClass's factory won't be
// executed unless explicitly required by someone

@param {Array} dependencies
@param {Object|Function} factory
Special version of define that executes the factory as soon as all dependencies are met .