Merge pull request #242 from akccakcctw/perf/better-perfomance-for-contributors-js

Update contributors.js for better performance
master
Mike Bryant 4 years ago committed by GitHub
commit dd6b3e30fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,12 +3,14 @@ function getContributors() {
const container = $('#contributors');
jQuery.ajax('https://api.github.com/repos/mikebryant/ac-nh-turnip-prices/contributors', {})
.done(function (data) {
const contributorList = [];
data.forEach((contributor, idx) => {
container.append(`<a href="${contributor.html_url}">${contributor.login}</a>`);
contributorList.push(`<a href="${contributor.html_url}">${contributor.login}</a>`);
if (idx < data.length - 1) {
container.append(', ');
contributorList.push(', ');
}
});
container.append(contributorList.join(''));
});
}
}

Loading…
Cancel
Save