require
require copied to clipboard
require with no callback should return module list
Suppose we do something like this:
require(['module1', 'module2']);
Since the corresponding one paramter calls
require('module1');
require('module2');
would return the module objects, I guess that what the user may expect in the first case is to get a list containing two modules. Does it make any sense?
@apendua I think that makes sense.
var moduleList = require(['module1', 'module2']);
// would return... [ module1obj, module2obj ]
Recently a came up with another idea. Due to usability reasons it seems better to return a handler with ready method similar to those returned by meteor subscriptions. Does it make any sense?
Actually, it would be better to call this function require.waitOn.