react-redux-merged-connect

0.0.3 • Public • Published

react-redux-merged-connect

utility that merges mapStateToProps and mapDispatchToProps to single function

Example usage

import { Component } from 'react'
import { shape, func, string } from 'prop-types'
import connect from 'react-redux-merged-connect'
import { actions } from 'src/state'

class Example extends Component {

  logout = () => {
    const { redux } = this.props
    redux.logoutUser()
  }

  render() {
    const { redux } = this.props
  }
}

Example.propTypes = {
  redux: shape({
    url: string,
    logoutUser: func,
  }),
}

const redux = state => ({
  url: state.ui.home.url,
  logoutUser: actions.auth.logout,
})

export default connect(redux)(Example)

Readme

Keywords

Package Sidebar

Install

npm i react-redux-merged-connect

Weekly Downloads

2

Version

0.0.3

License

none

Unpacked Size

26.7 kB

Total Files

6

Last publish

Collaborators

  • pavliha