cantierecreativo/redux-bees

Usage with React-Redux?

Closed this issue · 0 comments

I'm not really sure how to use this library with React-Redux. I've got things wired up and I can see data in the bees section of the store and request data directly from the API, but how do you use mapStateToProps and mapDispatchToProps here?

Assuming apiEndpoints includes getBee: { method: get, path: '/bee/:id' }

Ho do you expose the actions and response from the API?

mapDispatchToProps(dispatch) { 
  return({
    beeActions: bindActionCreators(/* something here */, dispatch),
  })
}

mapStateToProps(state) {
  return({
    bee: /* the bee resource (beesource, if you will) */
  })
}

And what if you're using include in the request? I see the getRelationship function in the React example, but how would you map those to the props? Is there a way to normalize that data passed into the prop? Is that what is supposed to be done?