Hacker News new | comments | show | ask | jobs | submit login

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




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: