Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Mar 6, 2019
1 parent 622ec3f commit 806eab3
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions packages/compose/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default compose(

Without `compose`, the code would look like this:

````js
```js
const applyWithSelect = withSelect( ( select, ownProps ) => {
return doSomething( select, ownProps);
} );
Expand All @@ -47,36 +47,22 @@ export default withPluginContext(
)
)
);

```

## Installation

Install the module

```bash
npm install @wordpress/compose --save
````
```

_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using [core-js](https://github.com/zloirock/core-js) or [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill) will add support for these methods. Learn more about it in [Babel docs](https://babeljs.io/docs/en/next/caveats)._

## Usage
An example using the HOC `withInstanceId` from the compose package:
```js
import { withInstanceId } from '@wordpress/compose';

function WrappedComponent( props ) {
return props.instanceId;
}

const ComponentWithInstanceIdProp = withInstanceId( WrappedComponent );
```
## API

For more details, you can refer to each Higher Order Component's README file. [Available components are located here.](https://github.com/WordPress/gutenberg/tree/master/packages/compose/src)

## API
<!-- START TOKEN(Autogenerated API docs) -->

### compose
Expand Down

0 comments on commit 806eab3

Please sign in to comment.