5 ms·
Doesn’t seem like there’s an NPM package. Would be better if you could import it with Webpack and use await rather than callbacks etc.
by benbristow 7y ago
Doesn’t seem like there’s an NPM package. Would be better if you could import it with Webpack and use await rather than callbacks etc.
- mrcarruthers 7y agoWell it's using promises, so you can just await those. But agreed, the documentation looks like it was written in 2014/2015.
- zodiakzz 7y agoThe "user's cloudAlbums" example is awful. Might as well use callbacks if you aren't gonna chain promises to avoid callback hell.
- tantalor 7y agoWhere is that? Link?
- zodiakzz 7y agoUnder the "JavaScript Methods" heading https://developer.apple.com/documentation/musickitjs#3004817 https://developer.apple.com/documentation/musickitjs#3004817 music.authorize().then(function() { music.api.library.albums.then(function(cloudAlbums) { // user's cloudAlbums }); }); Should be: music.authorize().then(function() { return music.api.library.albums; }).then(function (cloudAlbums) { // user's cloudAlbums });
- lqs469 7y agoIt looks like Apple doesn't want to use the NPM ecosystem.