examples/HTML StarterKit/lib/durandal/js/system.js
function() {
            var modules,
                first = arguments[0],
                arrayRequest = false;

            if(system.isArray(first)){
                modules = first;
                arrayRequest = true;
            }else{
                modules = slice.call(arguments, 0);
            }

            return this.defer(function(dfd) {
                require(modules, function() {
                    var args = arguments;
                    setTimeout(function() {
                        if(args.length > 1 || arrayRequest){
                            dfd.resolve(slice.call(args, 0));
                        }else{
                            dfd.resolve(args[0]);
                        }
                    }, 1);
                }, function(err){
                    dfd.reject(err);
                });
            }).promise();
        }
function() {
            var modules,
                first = arguments[0],
                arrayRequest = false;

            if(system.isArray(first)){
                modules = first;
                arrayRequest = true;
            }else{
                modules = slice.call(arguments, 0);
            }

            return this.defer(function(dfd) {
                require(modules, function() {
                    var args = arguments;
                    setTimeout(function() {
                        if(args.length > 1 || arrayRequest){
                            dfd.resolve(slice.call(args, 0));
                        }else{
                            dfd.resolve(args[0]);
                        }
                    }, 1);
                }, function(err){
                    dfd.reject(err);
                });
            }).promise();
        }
function ( ) { var modules , first = arguments [ 0 ] , arrayRequest = false ; if ( system . isArray ( first ) ) { modules = first ; arrayRequest = true ; } else { modules = slice . call ( arguments , 0 ) ; } return this . defer ( function ( dfd ) { require ( modules , function ( ) { var args = arguments ; setTimeout ( function ( ) { if ( args . length > 1 || arrayRequest ) { dfd . resolve ( slice . call ( args , 0 ) ) ; } else { dfd . resolve ( args [ 0 ] ) ; } } , 1 ) ; } , function ( err ) { dfd . reject ( err ) ; } ) ; } ) . promise ( ) ; }
Uses require.js to obtain a module. This function returns a promise which resolves with the module instance. You can pass more than one module id to this function or an array of ids. If more than one or an array is passed, then the promise will resolve with an array of module instances.
@method acquire
@param {string|string[]} moduleId The id(s) of the modules to load.
@return {Promise} A promise for the loaded module(s).
Uses require . js to obtain a module . This function returns a promise which resolves with the module instance . You can pass more than one module id to this function or an array of ids . If more than one or an array is passed then the promise will resolve with an array of module instances .