Re: [w3c/webcomponents] Remove `Callback` suffix from custom elements callbacks (#414)

With ES6+ object destructuring it will become less a pain to do so:
```es6
let { connected, attributeChange, disconnected } = customElements.symbols;

export class MyClass extends HTMLElement {
    [connected]() {}
    [attributeChange]() {}
    [disconnected]() {}
    normalMethod() {}
}

// or an object in well known symbols

let { connected: onAdded, observedAttributes: attrs, disconnected: onRemove } = Symbol.elements;

export class MyClass extends HTMLElement {
    static get [attrs]() { return ... }
    [onAdded]() {}
    [onRemove]() {}
    normalMethod() {}
}
```
Still in plain old es5 you can write less than `[customElements.connected]` if you choose to:
```js
var S = customElements.symbols;
function MyClass() {}
MyClass.prototype = Object.create(HTMLElement.prototype);
MyClass[S.observedAttributes] = 'attr1 attr2 attr3'.split(' ')
MyClass.prototype[S.connected] = function() {}
...
```

This is highly customisable by web developpers using the Symbols.


-- 
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/414#issuecomment-274211545

Received on Saturday, 21 January 2017 00:00:33 UTC