use Json to put the args in ...
emit: function(options) {
options.arguments.each(function(....
}
emit({"arguments" : [ "a1":"Arg1","a2":"Arg2","a3":"Arg3"]});
Alex Mcauley
http://www.thevacancymarket.com
----- Original Message -----
From: "fma" <[email protected]>
To: "Prototype & script.aculo.us" <[email protected]>
Sent: Monday, December 07, 2009 8:52 AM
Subject: [Proto-Scripty] Custom signal
>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.
>
>
>
--
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.