Почему нам нужно отсортировать по asc? - PullRequest
0 голосов
/ 03 ноября 2018
class Github {
    constructor() {
        this.client_id = '44b38368d3defba969d5';
        this.client_secret = '1bd40274a7e6b9baa847935eaba35e2b7c325ec4';
        this.repos_count = 5;
        this.repos_sort = 'created: asc';

    }

    async getUser(user) {
        const profileResponse = await fetch(`https://api.github.com/users/${user}?client_id=${this.client_id}&client_secret=${this.client_secret}`);

        const repoResponse = await fetch(`https://api.github.com/users/${user}/repos?per_page=${this.repos_count}&sort=${this.repos_sort}&client_id=${this.client_id}&client_secret=${this.client_secret}`);

        const profile = await profileResponse.json();
        const repos = await repoResponse.json();

        return {
            profile,
            repos
        }
    }
}

Пожалуйста, объясните использование метода сортировки ASC здесь. По сути, мне также нужно отсортировать репозитории Github.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...