Re: [w3c/webcomponents] [idea] Make use of `observedAttributes` optional (#565)

I think having `observedAttributes` either an `Array` or a `RegExp` would solve pretty much every issue raised in here. "catch-all" would be as easy as `/.*/` and it's possible to filter out stuff like `/^(?!data-)/` or `/^(?!style$)/` to rule out style only.

If the attribute name matches the RegExp then the method is triggered.

The current Array could be also represented as RegExp:
```js
["my-attr", "my-other"]
/^(?:my-attr|my-other)$/
```
For performance concerns, if any faster, developers can still use the Array and let browsers optimise it as possible.

My 2 cents

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/565#issuecomment-248270865

Received on Tuesday, 20 September 2016 11:07:35 UTC