You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ and renders declaratively using `lit-html`.
43
43
*`reflect`: Indicates if the property should reflect to an attribute.
44
44
If `true`, when the property is set, the attribute is set using the
45
45
attribute name determined according to the rules for the `attribute`
46
-
propety option and the value of the property serialized using the rules from
46
+
property option and the value of the property serialized using the rules from
47
47
the `type` property option.
48
48
*`hasChanged`: A function that indicates if a property should be considered
49
49
changed when it is set. The function should take the `newValue` and `oldValue`
@@ -161,7 +161,7 @@ into the element. This is the only method that must be implemented by subclasses
161
161
162
162
*`update(changedProperties)` (protected): This method calls `render()` and then uses `lit-html`
163
163
in order to render the template DOM. It also updates any reflected attributes based on
164
-
property values. Setting properties inside this method will *not* trigger another update..
164
+
property values. Setting properties inside this method will *not* trigger another update.
165
165
166
166
*`firstUpdated(changedProperties)`: (protected) Called after the element's DOM has been
167
167
updated the first time, immediately before `updated()` is called.
@@ -175,8 +175,8 @@ into the element. This is the only method that must be implemented by subclasses
175
175
176
176
*`updateComplete`: Returns a Promise that resolves when the element has completed
177
177
updating. The Promise value is a boolean that is `true` if the element completed the
178
-
update without triggering another update. This happens if a property is set inside
179
-
`updated()`. This getter can be implemented to await additional state.
178
+
update without triggering another update. The Promise result is `false` if a
179
+
property was set inside `updated()`. This getter can be implemented to await additional state.
180
180
For example, it is sometimes useful to await a rendered element before fulfilling
181
181
this Promise. To do this, first await `super.updateComplete` then any subsequent state.
182
182
@@ -195,14 +195,15 @@ into the element. This is the only method that must be implemented by subclasses
195
195
196
196
## Advanced: Update Lifecycle
197
197
198
-
* When the element is first connected or a property is set (e.g. `element.foo = 5`)
199
-
and the property's `hasChanged(value, oldValue)` returns `true`.
198
+
* A property is set (e.g. `element.foo = 5`).
199
+
* If the property's `hasChanged(value, oldValue)` returns `false`, the element does not
200
+
update. If it returns `true`, `requestUdpate()` is called to schedule an update.
200
201
*`requestUpdate()`: Updates the element after awaiting a [microtask](https://jakearchibald.com/2015/tasks-microtasks-queues-and-schedules/) (at the end
201
202
of the event loop, before the next paint).
202
203
*`shouldUpdate(changedProperties)`: The update proceeds if this returns `true`, which
203
204
it does by default.
204
205
*`update(changedProperties)`: Updates the element. Setting properties inside this
205
-
method will *not* trigger the element to update.
206
+
method will *not* trigger another update.
206
207
*`render()`: Returns a `lit-html` TemplateResult (e.g. <code>html\`Hello ${world}\`</code>)
207
208
to render element DOM. Setting properties inside this method will *not* trigger
0 commit comments