-
Notifications
You must be signed in to change notification settings - Fork 906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ReactiveElement] Adds scheduleUpdate()
#2097
Conversation
Fixes #2091. Fixes an issue where `performUpdate` was doing double duty as (1) make the element complete a pending update synchronously and (2) override to control update timing. Here `scheduleUpdate()` is added to satisfy (2), reserving (1) for `performUpdate()`. Since by default `scheduleUpdate()` just returns the value of `performUpdate()` this should not break any existing code. However, the docs are updated to recommend that for scheduling `scheduleUpdate()` be implemented in favor of `performUpdate()`.
🦋 Changeset detectedLatest commit: b2beae2 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📊 Tachometer Benchmark ResultsSummarynop-update
render
update
update-reflect
Resultslit-element-list
render
update
update-reflect
lit-html-kitchen-sink
render
update
nop-update
lit-html-repeat
render
update
lit-html-template-heavy
render
update
reactive-element-list
render
update
update-reflect
|
* method is overridden, `super.performUpdate()` must be called. | ||
* Schedules an element update. You can override this method to change the | ||
* timing of updates. If this method is overridden, `super.scheduleUpdate()` | ||
* must be called. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add that it should return a promise when overridden.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Co-authored-by: Justin Fagnani <justinfagnani@google.com>
Fixes #2091. Fixes an issue where
performUpdate
was doing double duty as (1) make the element complete a pending update synchronously and (2) override to control update timing. HerescheduleUpdate()
is added to satisfy (2), reserving (1) forperformUpdate()
. Since by defaultscheduleUpdate()
just returns the value ofperformUpdate()
this should not break any existing code. However, the docs are updated to recommend that for schedulingscheduleUpdate()
be implemented in favor ofperformUpdate()
.