After working with Form.EventObserver and Form.Element.EventObserver I wonder if they shouldn't pass the Event object to the callback, either in addition to the current arguments or by default.
If you want to get the element that fired an event using the Form.EventObserver, you end up having to compare data on every element which makes for a big mess.
If we passed the Event object this could easily be achieved and also preserve the original intent of the function.
Form.EventObserver('form', function(event, value) {
var element = Event.element(event);
var form = Event.findElement(event, 'form');
//Do other stuff
});
I think the intentions were maybe to follow the conventions of Abstract.TimedObserver, but this doesn't monitor native events and thus doesn't have an Event object being passed around.
Without access to the Event object the usefulness of both of these methods is fairly limited and it breaks from consistency with other native event based observers.
Is there any reason that I'm not aware of as to why the Event object isn't being passed to the callback?
-Cheers