How does BreezeJS track property changes

不羁的心 提交于 2019-12-11 04:22:26

问题


I am curious about how BreezeJS is able to determine which properties of an entity have changed and still support IE8?

I am in the need of similar functionality for a library I am building. JavaScript setters/getters would be the easiest solution however they are not support on non-dom objects in IE8.

Are they using something like : https://gist.github.com/eligrey/384583 : or something else?


回答1:


It depends on the "modelLibrary" in use, for backbone and knockout Breeze uses the "observability" of the underlying knockout or backbone objects. For something like AngularJS, where there is no requirement for an underlying object to support observability, Breeze uses its "backingStore" model library which does something very similar to the Object.watch implementation that you are pointing to in your question.

The "backingStore" implementation, like the Object.watch implementation above will NOT work on IE8 because there is no support for javascripts "defineProperty".

Hope this helps.



来源:https://stackoverflow.com/questions/16367365/how-does-breezejs-track-property-changes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!