notrab / react-use-cart

React hook library for managing cart state
http://npm.im/react-use-cart
Apache License 2.0
367 stars 48 forks source link

feat: handle addItem & updateItemQuantity events properly #26

Closed halafy-ds closed 4 years ago

halafy-ds commented 4 years ago

On addItem, update event should fire when item is already in cart and updating item quantity to 0 should fire a remove event

notrab commented 4 years ago

Hey @halafy-ds

This is a good approach actually. I'll add some documentation to the README for anyone who may be expecting anything different.

halafy-ds commented 4 years ago

Hi, Yes because with the previous approach the gatsby-graphcms-ecommerce-starter seems to be a little buggy with its cart management. I thinks this starter is a an good showcase for the package so maybe it can help.