Use render props instead of HOC-style `connect`?
- Dominant language
- JavaScript
- Stars
- 3.4k
- Forks
- 137
- PR merge metrics
- No merged PRs in 30d
Description
First off, thank you for this library, it is awesomely simple!
I've been toying with `react-apollo` and the new `` and `` components, and they are really nice in terms of making data declarative, allowing you to co-locate data requirements inside your components.
I was thinking it would be really nice is `react-refetch` was architected similarly. Instead of `connect(mapPropsToRequests, Component)`, it would be cool do to:
```js
{(fetch) => (
return fetch.pending ? (
) : fetch.rejected ? (
) : (
)
)}
```
Or even, for non-GET methods, offer a mutation API:
```js
{(updateUser, fetch) => (
return fetch.rejected ? (
) : (
Save
)
)}
```
What do you think?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.