const connect = (mapStateToProps, mapDispatchToProps) =>
Component => {
return class extends React.Component {
render() {
console.log('store', store)
return (
<Component
{...this.props}
{...mapStateToProps(store.getState(), this.props)}
{...mapDispatchToProps(store.dispatch, this.props)}
/>
)
}
componentDidMount() {
store.subscribe(this.handleChange)
}
handleChange = () => {
this.forceUpdate()
}
}
}