Skip to content

Commit 94c450c

Browse files
committed
Updated Readme
1 parent 2ba7492 commit 94c450c

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

README.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
# react-with-spinner
2+
23
[![Build Status](https://travis-ci.org/beanloop/react-with-spinner.svg?branch=master)](https://travis-ci.org/beanloop/react-with-spinner)
34
[![npm version](https://badge.fury.io/js/react-with-spinner.svg)](https://badge.fury.io/js/react-with-spinner)
45
[![License](http://img.shields.io/:license-mit-blue.svg)](http://doge.mit-license.org)
56

67
React HOC for displaying a Spinner component while loading.
78

89
## Install
9-
```
10+
11+
```shell
1012
yarn add react-with-spinner
1113
npm install --save react-with-spinner
1214
```
1315

1416
## Usage
17+
1518
By default withSpinner will look for the property `data` and if
1619
that property contains an loading property that is true then
1720
it will render a `Spinner`.
@@ -22,7 +25,7 @@ import {withSpinner} from 'react-with-spinner'
2225

2326
const Component = compose(
2427
WrappedComponent => props => <WrappedComponent {...props} data={{loading: true}} />,
25-
withSpinner(),
28+
withSpinner({spinnerComponent: SomeCustomSpinnerConponent}),
2629
)(() => <div></div>)
2730

2831
```
@@ -40,24 +43,9 @@ const Component = compose(
4043

4144
```
4245

43-
The `spinnerComponent` defaults to a React Toolbox ProgressBar component. However, it is possible
44-
to provide your own component:
45-
46-
```typescript
47-
import compose from 'recompose/compose'
48-
import {withSpinner} from 'react-with-spinner'
49-
50-
const Loading = () => <span>Loading...</span>
51-
52-
const Component = compose(
53-
WrappedComponent => props => <WrappedComponent {...props} data={{loading: true}} />,
54-
withSpinner({spinnerComponent: Loading}),
55-
)(() => <div></div>)
56-
57-
```
58-
5946
For more usages, check out the [tests](https://github.com/beanloop/react-with-spinner/blob/master/src/index.test.tsx)
6047

6148
## License
49+
6250
react-with-spinner is dual-licensed under Apache 2.0 and MIT
6351
terms.

0 commit comments

Comments
 (0)