News for hackers. Stuff that matters.
Re:JavaScript is Good, Actually by maga on Wednesday May 16, 2018 @06:16AM (#17081232)
We use proxies to watch models in our in-house MVC framework[1] and all those use cases are covered. You can watch setting array items with indexes, nested objects etc. It did take some jumping through hoops because the model also has to extend EventTarget which didn't like proxies. And we had to keep track of nested objects without creating new proxies on every call, but it's still not a rocket science.

Here the code of the model implementation: https://github.com/zandaqo/compago/blob/master/src/model.js

[1]https://github.com/zandaqo/compago

There are no comments on this comment yet.