adopted-ember-addons / adopted-ember-addons/ember-infinity

Support Server Polling

Đang mở
#335 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
374
Fork
128
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

Hi!

I ran into a situation where I want my page to be infinitely scrollable but also populate the top of the page with new objects that come in from the server.

So right now I have an infinity model that successfully loads data, but I have a polling event that refreshes some of the loaded data, which breaks data relationships in the infinity model.

I was able to fix it for my use case, but it would be ideal to incorporate an update option that doesn't break relationships of non-updated objects.

It would be great if I could ask the infinity model to basically make the first call again and have it update the store with new objects, or any objects that have been updated.

Here's the polling code (which is managed by ember-concurrency):
```
this.get('item').reload().then(item => {
item.get('allOrders').reload()
});
```

And the infinity model is loaded through a model hook on a route.

I should also note that I'm using cursor based pagination, and the results coming back from the server are already ordered.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.