- From: Joe Pea <notifications@github.com>
- Date: Sun, 02 Sep 2018 08:46:12 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Sunday, 2 September 2018 15:46:33 UTC
@alice An example of **option 5** for element semantics would be like
```js
// ...
const {withSemantics} = customElements.elementFeatures
class MyEl extends withSemantics( HTMLElement ) {
// ...
receiveSemantics( semantics ) {
const privates = elementPrivates.get(this);
privates.semantics = semantics;
}
}
customElements.define('my-el', MyEl)
```
where in this example, the `receiveSemantics` callback will be called by the `withSemantics` mixin implementation. So `receiveSemantics` (or whatever it will be called) should only be defined on classes that have an application of the `withSemantics` mixin.
--
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/758#issuecomment-417939788
Received on Sunday, 2 September 2018 15:46:33 UTC