I’m starting to build my own abstraction layer over the many $.ajax calls that I do (I’m not using ember-data but a more of the same approach discourse uses).
Example (coffee-script):
AjaxStore.delete "/api/resources/:id", resource, body, (resp)->{ #done! }
Variables in the route (here, :id
) will be pulled out from properties of resource
, body will be pushed up as JSON
, and you’d get a chance to process response as resp
.
Feels like reinventing the wheel - before I proceeed, anyone bumped into this kind of thing?
Thanks