fat/bean — Issue #59: Pass event object as first argument when listening to objects?
Author: html5anchor
Created: 2012-02-11 19:48:11+00:00
State: open

Hi

First of all, great work on Bean! I find myself using it all the time.

I am writing a bridge so I can switch between using the jQuery events API and Bean.
Everything goes fine except for events fired on objects. There is a difference in arguments passed to the callback function in jQuery and Bean and I am not sure which one has it right:

### Setup:

var dummy = {};

### Bean:

bean.add(dummy, 'message', function(message) {

console.log(message); // (string) hello
});

bean.fire(dummy, 'message', ['hello']);

### jQuery:

jQuery(dummy).on('message', function(message) {

console.log(message); // (object) event
});

jQuery(dummy).trigger('message', ['hello']);