Skip to content

Implement a function to defer rendering via promise chaining#180

Closed
tomdale wants to merge 2 commits intomasterfrom
danmcclain-deferred-rendering
Closed

Implement a function to defer rendering via promise chaining#180
tomdale wants to merge 2 commits intomasterfrom
danmcclain-deferred-rendering

Conversation

@tomdale
Copy link
Contributor

@tomdale tomdale commented Apr 21, 2016

This is #169 with the merge conflict resolved

let deferred = Ember.RSVP.defer();

Ember.run.later(() => {
if (!this.get('isDestroyed')) {
Copy link
Contributor

@stefanpenner stefanpenner Apr 21, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this callback should not bet let run if the component has been destroyed. Instead on destroy, we should actually cancel this timer, and more importantly we should also cleanup/resolve the promise.

Otherwise we cause the component (and everything it references) to be retained until the timer finally fires, although we know it has been destroyed earlier.

@danmcclain
Copy link
Member

#169 has been updated, this is no longer needed

@danmcclain danmcclain closed this Apr 27, 2016
@danmcclain danmcclain deleted the danmcclain-deferred-rendering branch May 11, 2016 21:06
xg-wang pushed a commit to xg-wang/ember-cli-fastboot that referenced this pull request Nov 16, 2020
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