-
-
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
Is it possible to use ember infinity with web sockets ? #367
Comments
@anpenava Do you have any code that you could share to help us figure out if it is possible? I'm thinking not since we depend on ember-data for fetching data, but I haven't dealt with websockets in an ember app before. |
@snewcomer This approach is also using ember data, but only peekAll every new event that comes in,because of sockets no need for requests, but that is my concern can this work with ember infinity. import Route from '@ember/routing/route';
export default Route.extend({
model() {
return {
points: this.get('store').peekAll('point'),
entries: this.get('store').peekAll('entry'),
};
},
setupController(controller, model) {
this._super(controller, model);
controller.someMethod();
}
}); from controller // someMethod(){...}
// some magic to subscribe and setup websockets
...
handlePointsUpdate(pointsRecordsPayload) {
console.log('Got data: ' + JSON.stringify(pointsRecordsPayload));
this.get("store").pushPayload('point', pointsRecordsPayload);
},
// handle entries... |
So basically I would need connect each my new subscribe to page 2,3,4,5... to infinity scroll logic |
@anpenava Seems like it would work using one of these methods -> https://github.com/ember-infinity/ember-infinity#service-methods What do you think? |
I am just wondering if I always peekAll my data from store can I still config this addon to give me specific number of data at the time.
The text was updated successfully, but these errors were encountered: