-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
"Calling set on destroyed object" #189
Comments
Hi @rhengeveld ! I'm currently working on a "modularization" of Ember Infinity that should help with this issue. Out of curiosity - are you using closure actions? something like |
Hello @hhff. Thanks for the swift response! This modularisation intrigues me :) I use closure actions and I used to with Ember Infinity, but in this instance the infinity-loader is used in conjunction with a component (sidebar menu).
I currently use this ugly (!) 😞 construction as a workaround.
Wrapped in a
I think that's all of the relevant code involved. |
Oh - are you using the InfinityRoute mixin directly in a component? ie
If so - that's an Ember anti-pattern that we don't support. Components should rarely own data. That's what routes are for! Components just take inputs, and display them, or trigger route / controller / service actions. |
Sorry, initially missed the Github update e-mail. Yes, I had (kind of) mentioned that it's used in a component :)
Thanks for mentioning it's an Ember anti-pattern. I hope to get around to changing this ... eventually. |
Note that the InfinityModel is used inside a component.
Very similar to #145, it is however still possible to trigger in the
_loadNextPage
of the route mixin.Triggering lines:
(via https://github.com/hhff/ember-infinity/blob/master/addon/mixins/route.js#L253)
(when I bypass the above trigger)
What seems to happen is that by the time the
_requestNextPage
finishes (due to slow response), the user has navigated away and the corresponding Infinity component has been destroyed.I guess I have to reopen and override
_loadNextPage
to work around this problem.The text was updated successfully, but these errors were encountered: