Created
October 8, 2018 16:58
-
-
Save jakiestfu/ac7eb2c33166fb8896ef4c8b44216451 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