cantierecreativo / redux-bees

A nice, short and declarative way to interact with JSON APIs
592 stars 41 forks source link

Is it possible to use standard HOC instead of decorator syntax? #50

Closed CoenWarmer closed 6 years ago

CoenWarmer commented 6 years ago

Hey there,

I would like to use the HOC of this library but I'm not able to use the decorator syntax due to other project requirements. Is it still possible to use the query and branch HOC's without the decorator syntax?

CoenWarmer commented 6 years ago

Never mind, I figured it out.

Went for:

const withApiData = query('data', api.getPage, (perform, ownProps) =>
  perform({ pageId: getPageSlug(ownProps.match) })
)

and

export default withApiData(connect(mapStateToProps)(Page))