tc39 / proposal-mass-proxy-revocation

Proposal for revoking proxies en masse.
MIT License
5 stars 1 forks source link

Proxies in the wild: Vue proxies #20

Open ajvincent opened 1 year ago

ajvincent commented 1 year ago

https://vuejs.org/guide/essentials/reactivity-fundamentals.html#reactive-proxy-vs-original

@caridy You suggested this. Can you elaborate on Vue proxies, please? I'm not that familiar with them.

caridy commented 1 year ago

In vue, any object returned by the data() method, transitively, it if is considered a POJO, or is one of the supported types (e.g.: Array, Map, Set, etc). it will automatically be wrapped by a Proxy whose proxy handler is a membrane implementation. This way, when values from those proxies are used to produce the final UI state, VUE can track their usage, and react if the value is updated at a later time.