Looking at the new observe ES6 featues inside object, I was wondering whether Ember and ES6 are equivalent or different? Can we use the Watchjs polyfill safely with ember?
Looking at the new observe ES6 featues inside object, I was wondering whether Ember and ES6 are equivalent or different?
Most definitely different. EmberJs has it own system, where every "model" (object whose properties may be observed), is wrapped in an instance of Ember.Object
.
The Ember.Object
base class provides all the mechanisms for listening for property changes.
In order to use them, all one needs to do is .get()
and .set()
to access and mutate its properties.
Can we use the Watchjs polyfill safely with ember?
I have not tried this before, but I would caution against it, as my educated guess is that it will not work. This is because, as mentioned above, Ember relies on get
ters and set
ters to listen for changes on object properties, not Object.observe
. So even if you use this WatchJs (or any other polyfill), EmberJs app would be oblivious to the changes, because Ember.Object
does not understand or use this at the moment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With