Deep Object Observing

# Eric Devine (10 years ago)

I've been experimenting with the Polymer-Project "prolyfill" Node.prototype.bind() function, and have rolled an implementation of my own that is dependent on Object.observe and MutationObserver.

The function binds to a path relative to a given object, so it must not only observe the descendant property, but it also must observe every object between and be able to recursively reconstruct the "chain" if a "link" is replaced, and recursively unobserve the replaced "links".

The recursive function to accomplish this is simple enough, but the memory footprint has the potential to become expensive when scaled.

I feel this feature is a good candidate for a native implementation. Is there any plans to bring the concept of deep object observing to ES?

# Brendan Eich (10 years ago)

Eric Devine wrote:

The recursive function to accomplish this is simple enough, but the memory footprint has the potential to become expensive when scaled.

I feel this feature is a good candidate for a native implementation. Is there any plans to bring the concept of deep object observing to ES?

No, but I have to ask: why do you think native would be better than JS self-hosted in terms of memory footprint?

Possibly related: swannodette.github.io/2013/12/17/the-future-of-javascript-mvcs.