Skip to content

Instantly share code, notes, and snippets.

@rw3iss
Last active February 10, 2021 13:12
Show Gist options
  • Save rw3iss/4b6f15c95c61ca62f36537b6a3a13851 to your computer and use it in GitHub Desktop.
Save rw3iss/4b6f15c95c61ca62f36537b6a3a13851 to your computer and use it in GitHub Desktop.
Load Github Stars for Repository
let url = 'https://api.github.com/repos/rw3iss/schemedream';
function loadGithubStarCount(url) {
const self = this;
fetch(url)
.then(r => r.json())
.then(r => {
self.setState({
githubStars: (r as any).stargazers_count
})
});
}
loadGithubStarCount(url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment