On 27 Dec, 2009, at 6:12 AM, [email protected] wrote:

> https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference:Global_Objects:Object:watch
> 
> I really do need it for my Modell-View-Controller application. If
> didn't had it, I had to use

That's funny, I didn't need it when I wrote the Coherent MVC library. There's 
no explicit call to update the UI, it's all achieved through the magic 
available in ES3. ES3! Not the goodness of ES5. (After all, it still has to 
work in IE.)

> modell.doSth();
> modell.x++;
> modell.save();
> 
> where modell.save() will call the controller to reload all properties
> into view. With the watch feature I'm saving the last line. Property
> changings on the modell affects the view instantly.

Now, you'll only be able to detect changes to raw properties on ES5 browsers, 
because IE doesn't support getters and setters, yet. But if you're willing to 
recraft your code to look like the following:

    model.doStuff();
    model.setX(model.getX()+1);

You'll be just fine on ES3 browsers.
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to