redux-short
v1.0.5
Published
Short, optimized and convenient connection of the component to redux
Downloads
2
Maintainers
Readme
Example:
import React from 'react';
import reduxShort from 'redux-short';
class Profile extends React.Component {
render() {
const { user } = this.props;
return (
<div>
{user.name}
</div>
);
}
}
export default reduxShort(['user'])(Profile);
import React from 'react';
import reduxShort from 'redux-short';
import { getUserByid } from '../action/userAction';
class Profile extends React.Component {
componentDidMount() {
this.props.getUserByid(...);
}
render() {
const { user } = this.props;
return (
<div>
{user.name}
</div>
);
}
}
export default reduxShort(['user'], { getUserByid })(Profile);