Re: [whatwg] Mutation Observer arguments format

On Mar 11, 2013 8:41 PM, "Alex Russell" <slightlyoff@google.com> wrote:
>
> Hi all,
>
> I had a moment today while trying to use Mutation Observers where it
wasn't
> clear to me what bits of the configuration passed to observe() are
required
> and which are configuration about required values. In particular, the
names
> "subtree" and "childList" feel like they should be peers, but it seems
> they're not.
>
> After a quick chat with Adam Klein, it seems like it might be easier to
> understand if the "childList", "attributes", and "characterData"
attributes
> of the configuration bag were rolled into a single value, e.g. "type" or
> "types". The observe() might then be written as:
>
>     observer.observe(node, { types: ["attributes", "childList"], subtree:
> true });
>
> This breaks the types of observation into a separate bag from the
> configuration for those observations.
>
> Thoughts?

Yes, i really like it :)

Received on Tuesday, 12 March 2013 00:45:11 UTC