Pass event payloads correctly in Basestar

This commit is contained in:
Andrew Stewart 2013-11-14 16:47:16 -08:00
parent 9811cd4b14
commit 6dd3e3384b
2 changed files with 5 additions and 5 deletions

6
dist/basestar.js vendored
View File

@ -41,11 +41,11 @@
targetEventName = opts.targetEventName || opts.eventName;
sendUpdate = opts.sendUpdate || false;
opts.source.on(opts.eventName, function() {
var args;
var args, _ref, _ref1;
args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
opts.target.emit(targetEventName, args);
(_ref = opts.target).emit.apply(_ref, [targetEventName].concat(__slice.call(args)));
if (sendUpdate) {
return opts.target.emit('update', targetEventName, args);
return (_ref1 = opts.target).emit.apply(_ref1, ['update', targetEventName].concat(__slice.call(args)));
}
});
return opts.source;

View File

@ -50,8 +50,8 @@ namespace 'Cylon', ->
targetEventName = opts.targetEventName or opts.eventName
sendUpdate = opts.sendUpdate or false
opts.source.on opts.eventName, (args...) =>
opts.target.emit(targetEventName, args)
opts.target.emit('update', targetEventName, args) if sendUpdate
opts.target.emit(targetEventName, args...)
opts.target.emit('update', targetEventName, args...) if sendUpdate
opts.source