adopted-ember-addons / adopted-ember-addons/ember-infinity
Non-blocking model hook breaks `reachedInfinity`
- 主要言語
- JavaScript
- スター
- 374
- フォーク
- 128
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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`?
コントリビューションガイド
評価
この issue はまだ評価されていません。