diff --git a/README.md b/README.md index f47561c..53e4f08 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,20 @@ const ExampleWithAsync = (props) => {return Much simpler, especially if your component is read-only, like the example. +## install + +With jspm: +``` +jspm i npm:react-async +``` +or with npm: +``` +npm i react-async +``` + ## [Available props](https://github.com/capaj/react-async/blob/master/async.js#L48): -- *promise* a promise you want to wait for -- *then* runs when promise is resolved. Async will run function provided in it's render passing a resolved value as first parameter. -- *catch* runs when promise is rejected. Async will run function provided in it's render passing an error as first parameter. -- *pendingRender*(optional) is a node which will be outputted from Async render method while promise is pending. If none is provided, defaults to `
` +- **promise** a promise you want to wait for +- **then**(optional) runs when promise is resolved. Async will run function provided in it's render passing a resolved value as first parameter. +- **catch**(optional) runs when promise is rejected. Async will run function provided in it's render passing an error as first parameter. +- **pendingRender**(optional) is a node which will be outputted from Async render method while promise is pending. If none is provided, defaults to `
` diff --git a/async.js b/async.js index 4035293..aebe785 100644 --- a/async.js +++ b/async.js @@ -49,7 +49,7 @@ Async.propTypes = { then: PropTypes.func, catch: PropTypes.func, pendingRender: PropTypes.node, - promise: PropTypes.object + promise: PropTypes.object.isRequired } export default Async diff --git a/package.json b/package.json index 29b8e34..c138cf0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-async", - "version": "1.0.1", + "version": "1.0.2", "description": "react.js component", "main": "async.js", "scripts": {