News for hackers. Stuff that matters.
Re:MusicKit JS by mrcarruthers on Saturday February 22, 2020 @03:08PM (#22393027)
Well it's using promises, so you can just await those.

But agreed, the documentation looks like it was written in 2014/2015.

Re:MusicKit JS by zodiakzz on Saturday February 22, 2020 @09:12PM (#22394646)
The "user's cloudAlbums" example is awful. Might as well use callbacks if you aren't gonna chain promises to avoid callback hell.
Re:MusicKit JS by tantalor on Saturday February 22, 2020 @10:18PM (#22394870)
Where is that? Link?
Re:MusicKit JS by zodiakzz on Saturday February 22, 2020 @10:45PM (#22394977)
Under the "JavaScript Methods" heading

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
    });