Hacker News new | comments | ask | show | 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


Applications are open for YC Summer 2019

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