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

[FEATURE] Adds sync observers back to tracked properties #18059

Merged
merged 1 commit into from
May 29, 2019

Conversation

pzuraq
Copy link
Contributor

@pzuraq pzuraq commented May 29, 2019

This PR flushes synchronous observers in the tracked feature flag path
during each notifyPropertyChange, which gives these observers similar
timing semantics to what they currently have without the feature flag
enabled. These changes are meant to only affect observers, and while the
metadata required is stored with listeners, this PR doesn't add "async
listeners" as a concept to the system.

The most notable change is the addition of the suspended property to
active observers. This property is used by setters which are being set
(computed property setters, and in the future dependentKeyCompat
setters), and when observers are triggered to prevent re-entry.

This PR flushes synchronous observers in the tracked feature flag path
during each `notifyPropertyChange`, which gives these observers similar
timing semantics to what they currently have without the feature flag
enabled. These changes are meant to only affect observers, and while the
metadata required is stored with listeners, this PR doesn't add "async
listeners" as a concept to the system.

The most notable change is the addition of the `suspended` property to
active observers. This property is used by setters which are being set
(computed property setters, and in the future `dependentKeyCompat`
setters), and when observers are triggered to prevent re-entry.
@pzuraq pzuraq force-pushed the tracked/flush-observers-synchronously branch from 03b0c59 to 0ce0174 Compare May 29, 2019 20:32
@rwjblue rwjblue merged commit 70bcd9f into master May 29, 2019
@rwjblue rwjblue deleted the tracked/flush-observers-synchronously branch May 29, 2019 23:33
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 this pull request may close these issues.

3 participants