react-fetch-loader

1.0.0 • Public • Published

React Fetch Loader

Higher order component for managing loading state and error state.

Usage Example

Props:

  • fetch: the AJAX call as a promise (required)
  • errorText: text to display on error state

Basic Example:

    <FetchLoader fetch={() => fetch('https://api.github.com/users/asafda')} errorText="Ooops...">
      <DataDisplayer/>
    </FetchLoader>

Installation

Via NPM:

npm install --save react-fetch-loader

Via Yarn:

yarn add react-fetch-loader

Readme

Keywords

none

Package Sidebar

Install

npm i react-fetch-loader

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • asafda