generated fromawibox/react-npm-package-template
- Notifications
You must be signed in to change notification settings - Fork1
This is NPM package with a component for React that will help you display the loader at use react-promise-tracker
License
NotificationsYou must be signed in to change notification settings
awibox/react-promise-loader
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
You need to install promise loader and promise tracker packages:
npm install react-promise-loader react-promise-tracker
You can use yarn:
yarn add react-promise-loader react-promise-tracker
Wrap promises that you would like to track as in the following example:
+ import { trackPromise} from 'react-promise-tracker';//...+ trackPromise( fetchUsers(); // You function that returns a promise+ );
Then you need to add the Loader component and send data from the react-promise-tracker:
+ import { usePromiseTracker } from 'react-promise-tracker';+ import Loader from 'react-promise-loader';const App = () => ( <div className="app"> ...+ <Loader promiseTracker={usePromiseTracker} color={'#3d5e61'} background={'rgba(255,255,255,.5)'} /> </div>);export default App;
| Parameter | Type | Description | Default |
|---|---|---|---|
| background | string | Sets the color for the background in any format that supports css | rgba(255,255,255,.5) |
| color | string | Sets the color of the spinner | #000 |
| promiseTracker | boolean | You need to setusePromiseTracker function from thereact-promise-tracker | false |
| loading | boolean | If you need to run the loader without tracking promises you should settrue | false |
| zIndex | number | You can change the z-index to distribute the layers correctly | 999 |
Please read through ourCONTRIBUTING.md.
About
This is NPM package with a component for React that will help you display the loader at use react-promise-tracker
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors5
Uh oh!
There was an error while loading.Please reload this page.