Skip to content
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] Add scheduleUpdate method #2091

Closed
sorvell opened this issue Aug 26, 2021 · 0 comments · Fixed by #2097
Closed

[ReactiveElement] Add scheduleUpdate method #2091

sorvell opened this issue Aug 26, 2021 · 0 comments · Fixed by #2097
Assignees
Milestone

Comments

@sorvell
Copy link
Member

sorvell commented Aug 26, 2021

We currently have an issue where performUpdate is doing double duty. Users can override it to schedule updates, but we also recommend that users can call it to make an update synchronous. To resolve this, we'll add scheduleUpdate and recommend users override that for scheduling and use performUpdate to make the update "go" synchronously.

We also need to update the docs on lit.dev to reflect this change.

@sorvell sorvell added this to the Lit RC.next milestone Aug 26, 2021
@sorvell sorvell self-assigned this Aug 26, 2021
sorvell pushed a commit that referenced this issue Aug 26, 2021
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()`.
sorvell pushed a commit that referenced this issue Aug 27, 2021
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()`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant