require icon indicating copy to clipboard operation
require copied to clipboard

require with no callback should return module list

Open apendua opened this issue 12 years ago • 3 comments

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 avatar May 14 '13 13:05 apendua

@apendua I think that makes sense.

var moduleList = require(['module1', 'module2']);
// would return... [ module1obj, module2obj ] 

alexhancock avatar May 14 '13 16:05 alexhancock

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?

apendua avatar Apr 01 '14 14:04 apendua

Actually, it would be better to call this function require.waitOn.

apendua avatar Sep 07 '14 09:09 apendua