Re: [w3c/webcomponents] [idea] Expose and API for syncing attributes and properties (#823)

I would love to see this put in the queue behind decorators and built-in modules so that one we have both of those browsers can offer a built-in `@reflect` decorator:

```js
import { @reflect } from 'std:custom-elements';

class MyElement extends HTMLElement {
  @reflect({name: 'my-attr'}) myAttr;
}
```

This is something @domenic has talked about before.

The tricky details here are around whether there's a callback for property changes, and deserialization. to non-string types. Setters already _are_ a callback for property changes, so arguably this need is taken care of, but in practice you often just want to pipe the change through one common callback to update the host.

-- 
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/823#issuecomment-506839721

Received on Friday, 28 June 2019 18:47:16 UTC