Created
October 8, 2018 16:49
-
-
Save jakiestfu/9177e52df63ab0d116d54cd29f9fd4c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { compose } from 'redux' | |
import { connect } from 'react-redux' | |
import { addToCart } from '../actions' | |
import { fetchProducts } from '../decorators' | |
const mapDispatchToProps = (dispatch) => ({ | |
add (product) { | |
dispatch(addToCart(product)) | |
}, | |
}) | |
export default ({ view, products }) => compose( | |
fetchProducts({ | |
skus: products, | |
}), | |
connect(state => state, mapDispatchToProps) | |
)(view) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment