redux-common
v2.1.0
Published
Mini Redux
Downloads
6
Readme
Mini Redux
Usage:
create React Component with mini-redux:
import React from 'React';
import { connect } from 'mini-redux';
class SomeComponent extends React.Component {
render() {
return <div>{this.props.someData}</div>;
}
}
export default connect(
'samplePage',
{ someData: 'good' }
) (SomeComponent);
change Redux Store with mini-redux:
import React from 'React';
import { connect } from 'mini-redux';
class SomeComponent extends React.Component {
onClick() {
this.props.commonAction({ someData: 'Be changed' });
}
render() {
return <div onClick=onClick>{this.props.someData}</div>;
}
}
export default connect(
'samplePage',
{ someData: 'good' }
) (SomeComponent);