-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add Ember.immediateObserver support #26
Conversation
I still need to add Function.prototype support |
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.
Looks good to me so far. I think we still need a test for the prototype extension code, right?
Yes still need to add a test for this case |
@rwjblue Should be good now. |
8556c66
to
fab5d36
Compare
Dang, I made a rebase conflict by merging the other PR. |
fab5d36
to
880aa7d
Compare
@rwjblue Fixed. We are going to be hitting a bunch of conflicts as they all touch ¯\_(ツ)_/¯ should be good to go |
const { EmberENV } = config; | ||
|
||
if (EmberENV.EXTEND_PROTOTYPES && EmberENV.EXTEND_PROTOTYPES.Function === true && Ember.immediateObserver) { | ||
Function.prototype.observesImmediately = Ember.immediateObserver; |
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.
Can we move this to a vendor file as well? Sorry for not noticing until the last minute :(
vendor/immediate-observer.js
Outdated
return _Ember.observer.apply(this, arguments); | ||
} | ||
|
||
const EXTEND_PROTOTYPES = JSON.parse(decodeURIComponent(document.getElementsByName('dummy/config/environment')[0].content)).EmberENV.EXTEND_PROTOTYPES; |
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.
@rwjblue I thought that global.EmberEnv contains the merged configs. I see the correctly merged content inside of the meta tag but not on the global. Do you know of a way to grab this from within vendor?
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.
Disregard this. Issue was with https://github.com/ember-cli/ember-disable-prototype-extensions
@rwjblue This should be good now |
Related: emberjs/ember.js#15894
Closes #8