|
75 | 75 | * or more property accessors (getter/setter pair) that enqueue an async
|
76 | 76 | * (batched) `_propertiesChanged` callback.
|
77 | 77 | *
|
78 |
| - * For basic usage of this mixin, simply declare attributes to observe via |
79 |
| - * the standard `static get observedAttributes()`, implement `_propertiesChanged` |
80 |
| - * on the class, and then call `MyClass.createPropertiesForAttributes()` once |
81 |
| - * on the class to generate property accessors for each observed attribute |
82 |
| - * prior to instancing. Last, call `this._enableProperties()` in the element's |
83 |
| - * `connectedCallback` to enable the accessors. |
| 78 | + * For basic usage of this mixin: |
| 79 | + * |
| 80 | + * - Declare attributes to observe via the standard `static get observedAttributes()`. Use |
| 81 | + * `dash-case` attribute names to represent `camelCase` property names. |
| 82 | + * - Implement the `_propertiesChanged` callback on the class. |
| 83 | + * - Call `MyClass.createPropertiesForAttributes()` **once** on the class to generate |
| 84 | + * property accessors for each observed attribute. This must be called before the first |
| 85 | + * instance is created, for example, by calling it before calling `customElements.define`. |
| 86 | + * It can also be called lazily from the element's `constructor`, as long as it's guarded so |
| 87 | + * that the call is only made once, when the first instance is created. |
| 88 | + * - Call `this._enableProperties()` in the element's `connectedCallback` to enable |
| 89 | + * the accessors. |
84 | 90 | *
|
85 | 91 | * Any `observedAttributes` will automatically be
|
86 | 92 | * deserialized via `attributeChangedCallback` and set to the associated
|
|
0 commit comments