What about reactivity? So much talks about it, but does it really reactive? How to solve current reactivity purposes. Future of Vue.js. Try to find answers in these slides.
29. ES6 Proxy all together
29/37
let data = {}; // target
const handler = {
set (obj, prop, value) {
if (obj[prop] !== value) {
obj[prop] = value;
notifyDataChanged();
}
}
data = new Proxy(data,handler);
30. ES6 Proxy
30/37
data = new Proxy(…);
data.cart = {
products: []
};
// notifyDataChanged receives changes on
state
34. Conclusions
34/37
• Proxy gives ability to build correct reactive system
• Don’t need use monkey-patching for arrays!
• V8 optimizations for proxies