Will Ember Data support full real-time updates?


#1

Will Ember Data support full real-time updates similar to Derby?


#2

I’ve done this successfully by using Socket.io and calling reload() on the affected models. As far as I can tell, it’s safe to call reload() when the following is true:

    (model.get("isLoaded") && !model.get("isSaving") &&
     !model.get("isError") && !model.get("isDeleted") &&
     !model.get("isDirty") && !model.get("isReloading"))

The tricky part is not accidentally reloading a model which isn’t already in the store. For that, I use something ugly and undocumented like:

   store.typeMapFor(type).idToCid[id.toString()]

This all requires some manual work, and it ignores a couple of corner cases, but it seems to work quite well in my experiments. Of course, if the in-memory model is dirty, things get more complicated…


#3

Yep, we are actively working on this.


Ember Data Sycn - LocalStorage + REST + RealTime + Online/Offline Support
#4

What is the current status of this? Has anyone been using the latest Ember Data with real-time updates?


#5

To find a record locally, you can use:

store.getById(type, id)

#6

hi tomdale, may I ask if there are any updates on this feature? Thks in ad