Ember without ember-data, and automatically updating controllers

(Alex Vidal) #1

I’m having a few issues with ember-data in the application I’m working on, and I’m thinking about replacing it. I’ve read the articles on @eviltrout’s blog (which are awesome, by the way); but I’m curious about something and having trouble tracking it down in the source.

When creating new Discourse model instances (such as Discourse.Topic), how are those additions propagated to the rest of the system? Creating a new Topic, setting the properties, then calling #save on it, that is. I’m assuming that the router/controller that drives your current topic list is fed via the message bus when you personally add a new topic. Is that correct?

(Alex Vidal) #2

Ah, I just read the post Vintage JavaScript begone by @sam which seems to confirm my findings.

I’m starting to think that really is the best way; let the backend tell you when there’s a new post and don’t try to maintain too much state on the client.

(Robin Ward) #3

In the future we will likely also include support for an identity map to share data in the client, and handle updating of objects via the message bus. For now though, our lightweight Ajax wrapper is serving us well :smile: