-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX release] Ensure
init
is completed before didReceiveAttrs
…
…fires. Given the following example: ```javascript export default Ember.Component.extend({ init() { this._super(...arguments); this.wasInitWithSomeThing = !!this.attrs.someThing; }, didReceiveAttrs() { this._super(...arguments); if (this.wasInitWithSomeThing) { // do custom logic based on being `init` with `someThing` } } }); ``` Currently, the `didReceiveAttrs` (and also `didInitAttrs`) is firing from within the `this._super()` call in `init` (because we trigger these hooks in `Ember.View`'s `init`). Which means that `didReceiveAttrs` can not have access to things set in `init`. This change allows us to avoid that circumstance, and ensure that `init` is fully completed before `didReceiveAttrs` is fired and also ensures taht `didReceiveAttrs`/`didInitAttrs` is still fired from within the `constructor` before observation is started.
- Loading branch information
Showing
3 changed files
with
55 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters