0.0.5 • Published 6 years ago

react-redux-decorate v0.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
6 years ago

A Collection of decorators to make using connect easier.

Installation

npm install react-redux-decorate

Example

import React from 'react'
import { mapDispatchToProps, mapStateToProps } from 'react-redux-decorate'

@mapStateToProps((state) => ({
  users: state.users
}))
@mapDispatchToProps((dispatch, ownProps) => ({
  getUser(id) {
    dispatch(ownProps.getUser(id))
  }
}))
export default class MyFancyComponent extends React.Component {
 // react things in here
}

Usage

mapStateToProps(mapStateToProps (Function), [options] (Object))

mapDispatchToProps(mapDispatchToProps(Function), [options] (Object))

fn and options follow the react-redux-api for connect

react-redux's connect is also in case of complicated use-cases

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago