CHANGES.md 1.0 KB

Event system changed to multiple arguments:

	context.emit('cmd:ls',1,2,3);
	context.on('module:ls',(a,b,c,evt) {
		evt.count
	});

Major code cleanup 1, organized some smaller modules

removed .do callback from with

before:
	context.with('module1','module2')
		.do((module1,module2) => {
			// Do things with modules
		}).else(() => {
			// Module does not exists
		});
after:
	context.with('module1','module2',(module) => {
		// Do things with modules
	}).else(() => {
		// Modules does not exists
	});

Created method call wrapper

before:
		context.with('module',(module) => {
			module.method(arg);
		});
after:
	// String is regular expression
	var ret = context.call('module:method',arg);
	var ret2 = context.call('(module1|module2):method',arg);
ret result:
ret: [ {name:'module1', result: ...}],
ret2: [ {name:'module1', result: ...}, {name: 'module2', result:...}]

although it only works with flat methods (i.e methods exported in module.exports)