Skip to content

Commit 2253e0d

Browse files
committed
Update types.
1 parent a06759a commit 2253e0d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

types/lib/mixins/property-accessors.d.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ declare namespace Polymer {
2121
* or more property accessors (getter/setter pair) that enqueue an async
2222
* (batched) `_propertiesChanged` callback.
2323
*
24-
* For basic usage of this mixin, simply declare attributes to observe via
25-
* the standard `static get observedAttributes()`, implement `_propertiesChanged`
26-
* on the class, and then call `MyClass.createPropertiesForAttributes()` once
27-
* on the class to generate property accessors for each observed attribute
28-
* prior to instancing. Last, call `this._enableProperties()` in the element's
29-
* `connectedCallback` to enable the accessors.
24+
* For basic usage of this mixin:
25+
*
26+
* - Declare attributes to observe via the standard `static get observedAttributes()`. Use
27+
* `dash-case` attribute names to represent `camelCase` property names.
28+
* - Implement the `_propertiesChanged` callback on the class.
29+
* - Call `MyClass.createPropertiesForAttributes()` **once** on the class to generate
30+
* property accessors for each observed attribute. This must be called before the first
31+
* instance is created, for example, by calling it before calling `customElements.define`.
32+
* It can also be called lazily from the element's `constructor`, as long as it's guarded so
33+
* that the call is only made once, when the first instance is created.
34+
* - Call `this._enableProperties()` in the element's `connectedCallback` to enable
35+
* the accessors.
3036
*
3137
* Any `observedAttributes` will automatically be
3238
* deserialized via `attributeChangedCallback` and set to the associated

0 commit comments

Comments
 (0)