Metaprogramming with ECMAScript 6 proxies
1–5 of 5 posts
Re: Metaprogramming with ECMAScript 6 proxies
#2 var proto = new Proxy({}, {
get(target, propertyKey, receiver) {
console.log('GET '+propertyKey);
return target[propertyKey];
}});
I've been following ES6 pretty closely, but somehow I missed this huge feature. Don't get me wrong, I love generators and destructuring, but this is soooo cool.Re: Metaprogramming with ECMAScript 6 proxies
#3This is huge. var proto = new Proxy({}, { get(target, propertyKey, receiver) { console.log('GET '+propertyKey); return target[propertyKey]; }}); I've been following ES6 pretty closely, but somehow I missed this huge feature. Don't get me wrong, I love generators and destructuring, but this is soooo cool.
Re: Metaprogramming with ECMAScript 6 proxies
#4This is huge. var proto = new Proxy({}, { get(target, propertyKey, receiver) { console.log('GET '+propertyKey); return target[propertyKey]; }}); I've been following ES6 pretty closely, but somehow I missed this huge feature. Don't get me wrong, I love generators and destructuring, but this is soooo cool.
Re: Metaprogramming with ECMAScript 6 proxies
#5This is huge. var proto = new Proxy({}, { get(target, propertyKey, receiver) { console.log('GET '+propertyKey); return target[propertyKey]; }}); I've been following ES6 pretty closely, but somehow I missed this huge feature. Don't get me wrong, I love generators and destructuring, but this is soooo cool.
Getters have been in JS since ES5 and can do what you just wrote. Obv Proxy is more powerful/has more traps.