4 ms·
I'm facing a similar situation, and my big question is: What's the alternative? Do I just roll my own REST layer on top of basic Ember objects or has someone fi
by dfltrmous 14y ago
I'm facing a similar situation, and my big question is: What's the alternative? Do I just roll my own REST layer on top of basic Ember objects or has someone figured out a working alternative?
- tmzt 14y agoember-rest and ember-resource are two much simpler alternatives. However, neither has the ambition or potential power of ember-data. Transactions are becoming better defined, it's possible to attach a model to a transaction much like you said and to commit that transaction independently of any default transaction. Ever other library I've looked at for this, and the roll-your-own solution would require that you implement hacks like cloning an existing model before editing, and won't actually gain you much. Another thing to consider, while the adapter is called the RESTAdapter, it is tightly coupled with a particular way of using Rails models. And unfortunately, at least when I was considering this approach, replacing it gets you back to the "roll-your-own" solution, so much of the state management logic was actually in the RESTAdapter that using a different way to pack multiple models required reimplementing it. It would be nice if the store would support an API that can update a model offline, or create a savable copy in a transaction, or handle a type of master-master synchronization when connection was restored. It has definately improved and the vision seems to be getting more concrete.