0.0.3 • Published 4 years ago

react-redux-merged-connect v0.0.3

Weekly downloads
17
License
-
Repository
-
Last release
4 years ago

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)
1.0.2

4 years ago

0.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago