Skip to content

jenross/github-battle-hooks

Repository files navigation

GitHub Battle (Hooks)

I created this project while completing Tyler McGinnis' "React Hooks" course.

About

"GitHub Battle" is a React application that pulls repository and user data from the GitHub API and displays popular repositories categorized by language (JavaScript, Ruby, Java, CSS, Python). The Battle component allows users to input two GitHub usernames and "battle" to see who has a better score/profile. These functions take in the data and calculate each GitHub user's score:

function getStarCount(repos) { return repos.reduce( (count, { stargazers_count }) => count + stargazers_count, 0 ); }

function calculateScore(followers, repos) { return followers \* 3 + getStarCount(repos); }

This project refactors the "GitHub Battle" app I created while completing Tyler McGinnis' "React" fundamentals course, which employed class component architecture. I was able to implement custom hooks and React's built-in Hook API's (including useState, useEffect, useContext, useReducer, useCallback, useMemo, and useRef).

Demo

Fetch popular repos:

Battle:

Peruse/Play

Check out the app here.

About

GitHub Battle web app built using React hooks (Tyler McGinnis course)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published