JSFiddle - React, Tailwind, and code Playground

by frosas

JavaScript

var showCommitAuthors = function(url, limit) {
    var processedCommits = []
    $.ajax({
        url: url,
        success: function(commit) {
            processedCommits.push(commit.commit.sha)    
            $('body').append(commit.commit.author.name + '<br />')
            commit.parents.forEach(function(parent) {
                if (! processedCommits.some(function(sha) { return sha === parent.sha })) {
                    if (limit) showCommitAuthors(parent.url, limit - 1)
                }        
            })
        },
        error: function(xhr, status, error) {
            alert(error)            
        }
    })
}
                
showCommitAuthors('https://api.github.com/repos/symfony/symfony/commits/master', 10)