Skip to content
This repository was archived by the owner on Jun 24, 2020. It is now read-only.

API Docs

Rhys Powell edited this page Oct 18, 2017 · 3 revisions

Table of Contents

React Components

Repo

Extends Component

A component for displaying the details of a GitHub repo

Parameters

  • props Object the React component's props
    • props.name string the full display name of the repo
    • props.url string a URL to the repo's GitHb page
    • props.language string the primary programming language in this repo
    • props.description string a short description of the repo
    • props.topics Array<string> the topics this repo belongs to
    • props.homepage string a URL to the project's homepage

RepoList

Extends Component

Displays a list of repository objects

Parameters

  • props Object the React component's props
    • props.repos Array the repositories to display

SearchBox

Extends React.Component

A controlled search input component

Parameters

  • props Object the React component's props
    • props.value string the field's current value
    • props.onChange function handler to be called when the input's value changes

Error

Extends React.Component

A component for displaying errors

Parameters

  • props Object the React component's props
    • props.message string the error message to display

React Container Components

App

Extends React.Component

The top level container component responsible for defining the app's basic layout and maintaining application-wide state (in this case the search term).

Parameters

  • props

SearchResultsRepoList

Extends React.Component

A container component that renders search results from the GitHub API based on its searchTerm prop.

Parameters

  • props Object the React component's props
    • props.searchTerm string the search term to display results for

Utilities

debounce

Returns a function, that, as long as it continues to be invoked, will not be triggered. The function will be called after it stops being called for N milliseconds. If immediate is passed, trigger the function on the leading edge, instead of the trailing.

Parameters

  • func function the function to debounce
  • wait number how long to wait for subsequent calls
  • immediate boolean whether the function should be triggered on the leading edge
Clone this wiki locally