On 10/27/06, markus espenhain <[EMAIL PROTECTED]> wrote:
>
> hi
>
> i tried to do something like this
>
> function f1() {
> d = new Deferred();
> callLater(0, d.callback, 1);
> return d;
> }
>
> function f2() {
> f1().addCallback(console.log, 'hello from f2');
> }
>
> f2();
> // nothing happens
>
> ... and i noticed that deferred methods are not bound to deferred obj
> and that it is done manual, e.g. in MochiKit.Async.wait() -
> m.bind("callback", d),
>
> so why deferred methods not bound by default to a deferred instance? -
> if there is a reason for that please be so kind to let me know
They're not bound by default because methods aren't bound in
JavaScript. To give the illusion of binding there'd be additional
overhead for every Deferred object instantiation and every method
call. MochiKit doesn't change how JavaScript works fundamentally.
-bob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" 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/mochikit
-~----------~----~----~----~------~----~------~--~---