Q: Spotify Web API - Fastest/lightest way to get all items on request with a limit At this moment, I am trying to get all tracks in a playlist (or all playlists from a user). The Spotify Web API doesn't allow to get more than 100 tracks from a playlist (or 50 playlists for the other scenario) at once. The data by the Spotify Web API contains the total number of tracks within the playlist. At this moment, I am using a while loop to get all the tracks, but this is incredibily slow.
So I was thinking, maybe someone could help me making it much faster.
The while loop I currently have is as follows:
let currentOffset = 50;
while(playlists.total > currentOffset) {
    $http.get(`https://api.spotify.com/v1/me/playlists?limit=50&offset=${currentOffset}`, {
        headers: {
            Authorization: `Bearer ${$rootScope.accessToken}`,
            Accept: 'application/json'
        }
    }).then((response) => {
        response.data.items.forEach(function (playlistItem) {
            if (playlistItem.owner.id == user.data.id || playlistItem.collaborative) {
                $scope.tempUserPlaylists.push(playlistItem);
            }
        });
        if((response.data.offset + response.data.limit) >= response.data.total) {
            $scope.userPlaylists = $scope.tempUserPlaylists;
            $timeout(() => {
                const playListContainer = $(".playlist-container");
                playListContainer.offset();
                playListContainer.css({
                    display: "initial",
                    transform: "scaleY(1)"
                });
            }, 0);
        }
    }, (error) => {
        console.log(error);
    });
    currentOffset+=50;
}

Also, I have an animation on $(".playlist-container") but the animation is very laggy, I guess it's because of the slow while-loop, but I don't know for sure.
Thanks in advance to all who are giving me a helping hand!
