Re: Specs and Object.observe()

On Mon, Jun 17, 2013 at 3:57 PM, Domenic Denicola <> wrote:

> What would change notifications look like for a Map, say? My impression of
> change notifications was that they usually applied to properties, not to
> general internal mutable state.

Naively, I would guess something like...

var o = {};
var m = Object.observe(new Map(), function(change) {
  console.log( change );

m.set(o, 1);

// Produces
    key: ...a reference to `o`
    object: ...a reference to `m`
    type: "new"

(the key reference to `o` is my concern point for Weak* object observation)

...Of course, this is just made-up for the sake of entertaining a question
that I don't have a better answer for ;)


Received on Monday, 17 June 2013 20:16:38 UTC