
Becoming fully reactive: an explanation of Mobservable - mweststrate
https://medium.com/@mweststrate/becoming-fully-reactive-an-in-depth-explanation-of-mobservable-55995262a254#.h1ihbtorr
======
teleclimber
This looks really interesting but there are a few caveats wrt Arrays:[1]

"Due to limitations of native arrays in ES5 (array.observe is only available
in ES7, and arrays cannot be extend),..."

"Bear in mind that Array.isArray(observable([])) will yield false, so whenever
you need to pass an observable array to an external library, it is a good idea
to create a shallow copy before passing it... "

Also, now that Object.observe has been removed from the standards track[2],
does anyone know the fate of Array.observe? MDN says it's not on std track
either.[3]

How are we going to write any sort of observable library that includes arrays
with zero support from the language? (At least Objects have getters and
setters and the ability to seal etc...)

[1]
[http://mweststrate.github.io/mobservable/refguide/observable...](http://mweststrate.github.io/mobservable/refguide/observable.html)
[2] [https://esdiscuss.org/topic/an-update-on-object-
observe](https://esdiscuss.org/topic/an-update-on-object-observe) [3]
[https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Refe...](https://developer.mozilla.org/en-
US/docs/Web/JavaScript/Reference/Global_Objects/Array/observe)

~~~
mweststrate
Object.observe was a bad idea. Even when it was available in chrome I didn't
consider using it. However, the ES6 proposal for object proxies will hopefully
become generally available as those can solve the same issue way more
elegantly. Proxies will be able to address the current limitations of arrays
in Mobservable.

I wrote a short blog post about the issue: [https://medium.com/p/object-
observe-is-dead-long-live-mobser...](https://medium.com/p/object-observe-is-
dead-long-live-mobservable-observe-ad96930140c5). Mobservable currently relies
on property getters / setters, both for arrays and objects. Probably until
proxies will be generally available.

