hicknhack-software / rails-disco

Distributed Rails with commands, events and projections.
MIT License
94 stars 4 forks source link

Ember Integration #18

Open gogogarrett opened 9 years ago

gogogarrett commented 9 years ago

Firstly, I really enjoyed reading through this code and the examples (as well as creating some small apps myself). I think this project is great and I would love to do it in more detail.

I would like to integrate this project with an ember app. I saw that there is a react example but I have a few questions around how that is handled.

I see here and [here] that you are manually reloading the page when ever a projection is updated from the backend. I'm not necessarily sure that would be the best experience from the end user.

Do you know of another way to handle the same problem? Perhaps send back the updated projection as json.. or I'm not sure.

Do you have any thoughts?

arBmind commented 9 years ago

Welcome to the world of Rails Disco.

I hope you manage to integrate it with your Ember app. If you have questions feel free to ask.

The reloading is actually the weakest part of our examples. We could not figure out a generic way to use of the events. It's dependant on your app and the front end framework like Ember. You actually should make better use of the event details.

All the event handling front end code is part of the Rails Disco application. You should implement a strategy for your app. Use websockets, longpolling or browser event sources with json data or whatever fits your app best.