winjs / angular-winjs

Project to smooth the AngularJS/WinJS interaction
Other
126 stars 46 forks source link

Optimizing the amount of watchers #105

Open koenvd opened 7 years ago

koenvd commented 7 years ago

I noticed that angular-winjs does create redundant watchers for the properties that as a user I'm not interested in.

Eg like if I define a menu command like: <win-menu-command label="ladadi ladada" </win-menu-command>

due to the way the api & bindings are created I will end up with 10 watchers for this element.

See https://github.com/winjs/angular-winjs/blob/master/js/angular-winjs.js#L253 where the bindings & watchers are created.

This can cause the number of watchers become very large impacting the speed of the app I'm making.

Therefore I was wondering if we can avoid the step for not creating a watcher per property? And what would be the best way to achieve that without breaking backwards compatibility?

Could we do something like <win-menu-command freeze label="ladadi ladada" </win-menu-command> where freeze would indicate to only create a watcher for the specified attributes?