-
Notifications
You must be signed in to change notification settings - Fork 319
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
Makes performUpdate
possible to call synchronously
#959
Conversation
Allows users to force elements to update synchronously.
Removes `forceUpdate` in favor of calling `performUpdate` in an accessor.
This can be useful to check, for example in a custom property setter.
I fear this will not help #643 at all. Basically it needs to intercept when a arbitrary, previously defined property is set / changed independently if will flush changes synchronous or not. |
src/lib/updating-element.ts
Outdated
} | ||
|
||
private get _hasRequestedUpdate() { | ||
protected get isUpdatePending() { |
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.
Why is it necessary to expose this (what use case is unlocked)?
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.
No clear use case. Removing for now.
@blikblum As @sorvell mentioned it does not solve #643 directly, but the idea is now a user can easily make a We're of the opinion that for most users, the default async/batched-render behavior is the correct default approach. However, this change should allow users with special needs for synchronous updates to be unblocked. |
Co-Authored-By: Kevin Schaaf <[email protected]>
It does not solve #643 directly nor indirectly
#643 is not about changing the update to be synchronous. Is meant to detect synchronously when the property value changed. How LitElement reacts to this change (asynchronously or not) is irrelevant to that use case. |
This is somewhat related to #643. While we're not adding direct support for synchronous updates, it's now possible to create properties that perform synchronous updates by calling
performUpdate
in the setter.