samedi 7 octobre 2017

Ember - Initializing table data from ember-data then updating via websocket

I have a table of data that I want to update dynamically.

When the user goes to the page, I want to initialize the table with data from my rails backend. Easy with the model hook and ember data.

I then want to keep this information refreshed using the connected websocket stream.

How should I manage this. Should I be updating the model with the websocket updates (without committing the data to the backend)? The table data is an object array in the component, should I just initialize this from the model setupController function then keep the array updated directly?

Is there an easy way to map the websocket data JSON into the model or table array?




Aucun commentaire:

Enregistrer un commentaire