This package has been deprecated

Author message:

use react-xcontrol

react-controlx

0.0.1 • Public • Published

react-controlx

Subscribe a react component to a controlx controller

Usage

subscribe(
  controllerInstance,
  mapStateToProps,
  mapActionsToProps
)
// todos/index.js
import subscribe from 'react-controlx'
import List from 'oui/List'
import { todosFilter } from '../../filter'

const mapStateToProps = () => ({
  items: Object.values(...todos.getWhere(
    todo => todosFilter.ok(todo)
  ))
})

const mapActionsToProps = () => ({
  setFilter: filter.set.bind(filter)
})

export default subscribe({ filter, todos })(
    mapStateToProps, mapActionsToProps
)(List)
// recieves todos: [ { id: 123, text: 'this', done: false }, ... ]

Readme

Keywords

Package Sidebar

Install

npm i react-controlx

Weekly Downloads

1

Version

0.0.1

License

MIT

Unpacked Size

18.5 kB

Total Files

9

Last publish

Collaborators

  • thk2b