Re: [w3c/webcomponents] How to define APIs only for custom element authors (#758)

Here's an example use case:

Suppose an element wants to observe children. It could be opt-in with a mixin:

```js
const {withChildren} = customElements.elementFeatures

class MyEl extends withChildren( HTMLElement ) {

  // this callback is provided by the `withChildren` mixin
  childrenChangedCallback() {
    // work with children here, don't worry about if children exist in `connectedCallback`.
    // Also children here are guaranteed to be already upgrade if they are custom
  }

}
```

-- 
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-417942419

Received on Sunday, 2 September 2018 16:27:10 UTC