-
-
Notifications
You must be signed in to change notification settings - Fork 129
Non-blocking model hook breaks reachedInfinity #441
Copy link
Copy link
Open
Description
It seems that reachedInfinity isn't usable when a non-blocking model hook is used. The value is always undefined in the template.
This works as expected and shows the actual value of reachedInfinity:
// route
model(){
return this.infinity.model('post');
}
// template
{{ @model.reachedInfinity }}
This does not work, and never shows any value for reachedInfinity:
// route
model(){
return { posts: this.infinity.model('post') };
}
// template
{{ @model.posts.reachedInfinity }}
If I wrap the hash in RSVP.hash it does show the correct value for reachedInfinity but that prevents the model hook from being non-blocking:
// route
model(){
return RSVP.hash({ posts: this.infinity.model('post') });
}
// template
{{ @model.posts.reachedInfinity }}
It seems like when the non-blocking model hook is used that the promise for the infinity model isn't resolved when trying to access reachedInfinity though it is resolved correctly when accessing the collection itself.
Am I missing something? Is there a good work around for using a non-blocking hook and being able to access reachedInfinity?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels