1.0.5 • Published 4 years ago
redux-short v1.0.5
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);