@morlay/redux-bootstrap

Bootstrap for my web redux react projects


License
WTFPL
Install
npm install @morlay/redux-bootstrap@0.0.1

Documentation

Redux Bootstrap

Bootstrap for my web redux react projects

Build Status NPM Dependencies

Grouped Packages

  • react
  • react-dom
  • redux
  • react-router
  • react-router-redux
  • react-redux
  • recompose
  • lodash

Extra APIs

bootstrap: Promise

bootstrap({
  history,
  location: ReactRouterLocation,
  getRoutes: (store) => ReactRouterPlainRoute,
  
  reducers: Object, // optional
  middlewares: Array,  // optional
  composes: Array, // optional
  initialState,
})
.then(({ redirectLocation, ...renderProps }) => {
  // do render in browser or server-side
})

same as react-router#mactch but return Promise resolve { [renderProps], [redirectLocation] } and reject err

  • store and history must be passed for react-router-redux#syncHistoryWithStore

<RouterProvider {...renderProps} client/>

connectStateProps(mapStateToProps) and connectDispatchProps(mapDispatchToProps)

same as react-redux#connect but simplify args.

  • mergeProps could use recompose#mapProps instead.

withRouting(Component)

provide { routing } in props,