Closed BaseMax closed 3 years ago
Hi Max, I knew about this (from the GitHub documentation) when I started working on GitZilla. But I took it lightly as I didn't know GitZilla will get such an amazing response from the dev community. Also, another reason is fetching all the repositories at a time will increase the loading time which will not result in good user experience. Hence I thought to just limit to single page.
This is my current code in src/components/User.jsx
-
Thanks for finding out this issue and reminding me again and giving an example. I will look into it and fix this very soon. I am thinking of something like fetching 100 repositories first and show them first and then fetching more as the user scrolls down. This will decrease the loading time.
But I am not very sure. As I don't know much about pagination and fetching. I am a beginner in react and working with API too.
Please suggest your views on this.
Thank you.
Self-assigning myself for this issue.
A good quick way to fix this would be adding a button for more, which is rendered only when the user's user.public_repos > page_number * 100
.
Here, page_number
, initially 1
is the current page number.
A simple fetch request can be made, and the data can be appended to the repos
state.
Self-assigning myself for this issue.
A good quick way to fix this would be adding a button for more, which is rendered only when the user's
user.public_repos > page_number * 100
.Here,
page_number
, initially1
is the current page number.A simple fetch request can be made, and the data can be appended to the
repos
state.
Glad to see your suggestion but I already started working on this issue. It will be fixed soon. Thank you! :smile:
Hi Khushbu,
I have about 300 public repository. But your app only receives 100 of them. Because GitHub web services only give 100. But you have to scan page by page.
Read more: https://developer.github.com/v3/#pagination
Take a look at this example: https://github.com/BaseMax/GitHubBackupArchiver/blob/master/download-repositories.php#L7
Regards, Max