MCPcopy Create free account
hub / github.com/basir/node-react-ecommerce / removeFromCartHandler

Function removeFromCartHandler

frontend/src/screens/CartScreen.js:14–16  ·  view source on GitHub ↗
(productId)

Source from the content-addressed store, hash-verified

12 const qty = props.location.search ? Number(props.location.search.split("=")[1]) : 1;
13 const dispatch = useDispatch();
14 const removeFromCartHandler = (productId) => {
15 dispatch(removeFromCart(productId));
16 }
17 useEffect(() => {
18 if (productId) {
19 dispatch(addToCart(productId, qty));

Callers

nothing calls this directly

Calls 1

removeFromCartFunction · 0.90

Tested by

no test coverage detected