A microframework to write reusable components based on Redux.
npm install redux-rexA microframework to write reusable components based on Redux.
``js
import { run } from 'redux-rex';
const namespace = 'Shop/Overview';
const initialState = {
counter: 0
};
const action = (actions, { dispatch, getState }) => ({
*incrementAsync(milliseconds) {
setTimeout(() => {
dispatch(actions.openDialog());
yield put(actions.increment());
}, milliseconds);
},
openDialog() {
fetch().then(dispatch(actions.openDialog()));
}
});
const reducer = (state) => ({
increment(num) {
state: state.value + num
},
openDialog(abc) {
}
});
// @run({
// action, reducer, initialState, namespace, mapStateToProps
// })
const ShopOverviewCard = React.Component({
PropTypes: {
device: React.PropTypes.number
},
render() {
return (
export default run({
view: ShopOverviewCard, action, reducer, initialState, namespace, mapStateToProps
})
``