Skip to content

Instantly share code, notes, and snippets.

@jakiestfu
Created October 8, 2018 16:58
Show Gist options
  • Save jakiestfu/ac7eb2c33166fb8896ef4c8b44216451 to your computer and use it in GitHub Desktop.
Save jakiestfu/ac7eb2c33166fb8896ef4c8b44216451 to your computer and use it in GitHub Desktop.
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