vendredi 25 décembre 2015

How do I update my EmberJS data model in a route after receiving new records via a websocket?

I am using a websocket to receive newly created models in my EmberJS app.

websocket.onMessage((data) => {
  this.store.push(data);
});

This works perfectly as I can confirm using the Ember inspector.

Annoyingly this doesn't update my existing template though. I am showing a list of items using:

model: function(){
  return this.store.findAll("posts");
}

There's a lot of questions like this one on StackOverflow but none seem to answer the real question. Anyone got an idea how this should be fixed?




Aucun commentaire:

Enregistrer un commentaire