withApollo.js basic HOC

import { compose } from 'redux'

const withApollo = ({ queries }, { mutations }, WrappedComponent) =>
  compose(
    ...queries,
    ...mutations,
  )(WrappedComponent)

export default withApollo

 

https://github.com/helabenkhalfallah/react-apollo-redux-graphql/blob/master/src/commons/hocs/withApollo.js

https://github.com/helabenkhalfallah/react-apollo-redux-graphql/blob/master/src/users/pages/UserListPage.jsx

 

 

best practices reactjs

×