4 ms·
I used ES6 proxies recently to write a program which monitors changes on javascript data structures, and generates operation objects reflecting the changes to s
by westoncb 8y ago
I used ES6 proxies recently to write a program which monitors changes on javascript data structures, and generates operation objects reflecting the changes to send to my data structure visualizer project[0].
You can see the source for the javascript client that does the monitoring with proxies here: https://github.com/westoncb/JS-Watcher/blob/master/watcher.js https://github.com/westoncb/JS-Watcher/blob/master/watcher.j... —it just works for arrays at the moment, but the basic idea is there. (I've written another much more complete client that does monitoring in Java; this JS one is more experimental.)
[0] https://www.youtube.com/watch?v=KwZmAgAuIkY https://www.youtube.com/watch?v=KwZmAgAuIkY
- sametmax 8y agoJust use mobx. It's a robust, proven, documented way to monitor changes on data sets.