I would like to raise signals between some of my application
components (mainly between the model and the controller).
I'm thinking of something like this:
var Signal = Class.create({
initialize: function () {
self._slots = new Array();
emit: function(arg1, arg2, ..., argn):
// ???
},
def connect(self, slot):
if (!self._slots.include(slot)) {
self._slots.push(slot);
}
},
def disconnect(self, slot):
if (self._slots.include(slot)) {
self._slots.splice(self._slots.indexOf(slot, 1);
}
},
def disconnectAll(self):
self._slots = new Array();
but I don't know how to implement the emit method. As each slot has a
different number of arguments, how can retreive them in a generic way?
--
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.