ultradom-redux
Ultradom bindings for Redux
Last updated 2 years ago by jmas .
MIT · Original npm · Tarball · package.json
$ cnpm install ultradom-redux 
SYNC missed versions from official npm registry.

ultradom-redux

Ultradom bindings for Redux.

Interface: connect(mergeStateAndProps, options)

  • mergeStateAndProps {Function} - merge store state and props that came from the top
  • options {Object} - options object
  • options.connectRootTag {String} - tag name of element outside of connected component
  • options.componentRootTag {String} - tag name of root element inside connected component

Defaults:

connect(
  (state, ownProps) => ({
    ...ownProps,
    ...state
  }),
  {
    connectRootTag: 'div',
    componentRootTag: 'div'
  }
)

Example:

function App(props) {
  return (
    <div>
      <button onclick={ props.actions.click() }>Click</button>
    </div>
  );
}

// Variables and functions:
// actions - action creators
// store - redux store
// bindActionCreators - redux helper

const AppConnected = connect((state, props) => ({ ...state, ...props, actions: bindActionCreators(actions, props.store.dispatch) }))(App)

// Attach component to DOM
// path - ultradom function

path(<AppConnectd store={store} />, document.getElementById('app'))

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

6 Versions

  • 1.0.0                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.10                                ...           2 years ago
  • 0.1.6                                ...           2 years ago
  • 0.1.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 17
Last Day 0
Last Week 0
Last Month 3
Dependencies (4)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |