Detecting change in a Javascript Object

后端 未结 3 442
Happy的楠姐
Happy的楠姐 2020-12-10 11:35

I found this gist to detect changes on specified fiels of a object : https://gist.github.com/3138469

But it bind an event only on one field.

Someone know a f

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-10 12:12

    This is currently not possible, you can only define getters/setters for individual properties.

    Yet, there is a draft for Proxy objects which could do that. Today, it is only supported in Firefox' Javascript 1.8.5.

提交回复
热议问题