Skip to content

Commit

Permalink
readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
capaj committed Dec 28, 2015
1 parent 9fb445b commit 373289a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,10 @@ const ExampleWithAsync = (props) => <Async promise={prom} then={(val) => {return
```
Much simpler, especially if your component is read-only, like the example.
## [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 `<div/>`

0 comments on commit 373289a

Please sign in to comment.