Open Floby opened 11 years ago
We're deploying this primarily for the performance of lookups using the C API compared to the other REST "wrapper" libraries. What exactly is your understanding of "loaded" / "ready" objects?
loaded object's method isReady
return true.
On 30 May 2013 12:21, Kenan Sulayman notifications@github.com wrote:
We're deploying this primarily for the performance of lookups using the C API compared to the other REST "wrapper" libraries. What exactly is your understanding of "loaded" objects?
— Reply to this email directly or view it on GitHubhttps://github.com/Floby/node-libspotify/issues/15#issuecomment-18672201 .
I'm also having difficulty with what you mean by 'loaded objects'. Use case?
I was thinking of moving all the API to an more classic async style like so
sp.Track.getFromUrl('spotify:track:fdskjhluyqzeljh', function (err, track) {
if (!err) {
track.isReady() === true;
}
})
I think that's a good idea. It keeps the whole API inline with Node stuff in general. I'd rather (as a consumer of the module) work in this manner.
+1 this would be great! I must say that I really like the api used in https://github.com/TooTallNate/node-spotify-web
This is something I'd like to discuss with people actually using this lib.
I first tried to stick as closely as possible to the C API, just adding some javascript sugar and grouping namespaced C functions to objects.
But it seems to me that the Node Way would tell us to give users only ready objects.
Feel free to comment.