2015-07-14 22:46:44 +03:00
|
|
|
import React, { Component } from 'react';
|
|
|
|
import { bindActionCreators } from 'redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import Counter from '../components/Counter';
|
|
|
|
import * as CounterActions from '../actions/CounterActions';
|
|
|
|
|
2015-08-07 19:49:40 +03:00
|
|
|
class CounterApp extends Component {
|
2015-07-14 22:46:44 +03:00
|
|
|
render() {
|
|
|
|
const { counter, dispatch } = this.props;
|
|
|
|
return (
|
|
|
|
<Counter counter={counter}
|
|
|
|
{...bindActionCreators(CounterActions, dispatch)} />
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
2015-08-07 19:49:40 +03:00
|
|
|
|
|
|
|
function select(state) {
|
|
|
|
return {
|
|
|
|
counter: state.counter
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(select)(CounterApp);
|