-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
[BUGFIX release] Ensure model can be observed by sync observers #18476
Conversation
} | ||
|
||
async '@test model can be observed with sync observers'(assert) { | ||
let observerDidRun = false; |
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.
nit: may as well make this a counter and assert that it fired exactly once
model: EMBER_METAL_TRACKED_PROPERTIES ? tracked() : null, | ||
model: computed({ | ||
get() { | ||
return this[MODEL]; |
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.
We may want to make this non-enumerable if there is an easy way to do it, but if it's too annoying it's not a big deal.
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.
The only way to do it currently is something I think we'd rather deprecate sooner rather than later (it requires some not-so-nice prototype chain manipulation), so I'd rather not for the moment
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.
Seems good to me
93cf8c7
to
17b3e9a
Compare
This is a compatibility change, otherwise sync observers will not be able to watch the model property of controllers at all. Also fixes the naming of the final flag to Observable#addObserver and Observable#removeObserver
17b3e9a
to
1d565fc
Compare
This is a compatibility change, otherwise sync observers
will not be able to watch the model property of controllers
at all. Also fixes the naming of the final flag to Observable#addObserver
and Observable#removeObserver
Fixes #18427