0.2.0-beta.2 • Published 8 years ago

react-fetch-loading v0.2.0-beta.2

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

Enhanced react component for loading on fetching

This package provides a single enhanced react component, which used for injecting loading component to a component using React HOC (Higher Order Component).

Installation

Using npm:

npm install --save react-fetch-loading

Using yarn:

yarn add react-fetch-loading

Importing package

Using ES5: var loadingInjector = require('react-fetch-loading');

Using ES6: import loadingInjector from 'react-fetch-loading';

Usage

The enhanced component only need one prop, which is a boolean for letting the enhanced component to know the fetching state, is it still fetching or done.

Using compose:

You can composing loadingInjector using another library like lodash or ramda.

let EnhancedComponent = compose(
  fetchingDataHOC(url),
  loadingInjector('isFetching'),
 )(ComponentThatNeedsLoadingIndicator);

or if you want to use stand-alone loadingInjector, you can simply wrap your presentational/stateless component using loadingInjector.

let EnhacedComponent = loadingInjector('isFetching')(ComponentThatNeedsLoadingIndicator);

Using react-redux:

let EnhancedComponent = connect(mapStateToProps)(loadingInjector('isFetching')(ComponentThatNeedsLoadingIndicator);

Then you can exporting the component simply by:

export default EnhancedComponent;

Loading Indicator:

Currently, we only have one indicator to show. Which is coming from material-ui circular progress. We'll provide more loading indicator soon!

npm.io

0.2.0-rc.2

8 years ago

0.2.0-rc.1

8 years ago

0.2.0-beta.2

8 years ago

0.2.0-beta.1

8 years ago

0.2.0-alpha.4

8 years ago

0.2.0-alpha.3

8 years ago

0.2.0-alpha.2

8 years ago

0.2.0-alpha.1

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago