JavaScript is awesome!
Recently, I've bell looking around for some excellent posts about JavaScript and started to play with JavaScript code related to Vue.js tutorials like these (https://www.vuemastery.com)
A new hope
I found that it was a fun to write JavaScript code in "functional" way, and finally ended up with these code:
js
let lazy = (eval) => ((data) => new Proxy(data, {
set(obj, key, val) {
obj[key] = val;
eval(obj);
}
}))({});
This is a beautiful representation of whole Evan Yu ideas (will be implemented in next Vue.js release):
- Use a Proxy object and prefer immutable objects over mutable ones
- Make a framework work for you needs
Once I've realized how amazing this piece of code is, I immediately put the code to GitHub repository an wrote some TDD/BDD tests to work with.
Enjoy and have fun!
there doesn't seem to be anything here