When to write a custom ember-data adapter?

I am writing an ember application that extracts most of its data from the Lastfm API. The API is not RESTful. I'm not sure what level of abstraction I should set up. Should I go the way of creating a LastFm custom ember data adapter? Or should I just go around the ember data?

They return data similar to this:

{ "recenttracks" : { "meta" : {}, "tracks" : [ { track info }, { track info } ] } } 

To request data, they have a scheme that includes sending the method parameter. So, not the worst, but certainly not RESTful.

Anyway, just looking for a bit of direction as I am new to ember data.

Thanks!

+4
source share
1 answer

Personally, I would create a new adapter, not necessarily a RESTAdapter , passing the find and findAll :

 var lastFmAdapter = DS.Adapter.create({ find: function (store, type, id) { }, findAll: function (store, type) { } }); 
+3
source

All Articles