Skip to content

Instantly share code, notes, and snippets.

@sammylupt
Last active April 25, 2016 17:31
Show Gist options
  • Save sammylupt/95a52f6f3dce2e64baffc845870be17b to your computer and use it in GitHub Desktop.
Save sammylupt/95a52f6f3dce2e64baffc845870be17b to your computer and use it in GitHub Desktop.
import { addToCart } from "shared/lib/actions"
class ProductContainer extends React.Component {
// ...
addToCart(product) {
const { dispatch, navigator } = this.props
return dispatch(addToCart(product, () => {
const route = Router.getCartRoute()
navigator.push(route)
}))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment