Skip to content

Commit

Permalink
docs: ✏️ added async example link
Browse files Browse the repository at this point in the history
  • Loading branch information
diogofcunha committed Oct 10, 2018
1 parent 83d783c commit cd307d7
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,16 @@ yarn add react-to-component
</ToComponent>
```

## Live examples

- #### Async example
[![Edit react-to-component async example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/92l7qw7l5p)

## Configuration

| Prop | Required | Default | Type | Description |
| ------------------- | -------- | --------------- | --------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| original | ✔️ | ✖️ | `(...params: P[]) => Promise<T> or T` | The original function to be encapsulated |
| params | ✔️ | ✖️ | `P[]` | The params that will be used in the function invocation |
| Prop | Required | Default | Type | Description |
| ------------------- | -------- | --------------- | ------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| original | ✔️ | ✖️ | `(...params: P[]) => Promise<T> or T` | The original function to be encapsulated |
| params | ✔️ | ✖️ | `P[]` | The params that will be used in the function invocation |
| children | ✔️ | ✖️ | `({ data: T or null, error: Error or null, loading: boolean }) => JSX.Element or JSX.Element[] or null` | The render prop that controls you data flow |
| parametersDidChange | ✖️ | Params equality | `(previousParams: P[], nextParams: P[]) => boolean` | Ability to supply a custom check for parameter equality, use this if for example you need to ignore some parameters for caching purposes |
| parametersDidChange | ✖️ | Params equality | `(previousParams: P[], nextParams: P[]) => boolean` | Ability to supply a custom check for parameter equality, use this if for example you need to ignore some parameters for caching purposes |

0 comments on commit cd307d7

Please sign in to comment.