frintjs/frint-props

frint-props: create `withStore`

fahad19 opened this issue · 0 comments

This function will take care of getting the store provider (which can either be a frint-store or Redux store instance), and map its state and dispatchable actions accordingly:

Expected API usage

withStore(
  mapStateToProps, 
  mapDispatchToProps, 
  storeProviderName  = 'store'
  appName = null
)
  • mapStateToProps: Function that accepts state tree object, and returns props-compatible object
  • mapDispatchToProps: Accepts action creators, and returns object keyed by their names, dispatching to Store
  • storeProviderName: Optional, and defaults to store
  • appName: Optional, defaults to null which means it will get the Store from the App instance in scope. Otherwise it will try to get another Child App by its name provided as string.