notrab / react-use-cart

React hook library for managing cart state

Home Page:http://npm.im/react-use-cart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expire after x hours without updates?

mattjis opened this issue · comments

Does the cart ever expire as is?

I don't want my customers coming back in a year with a cart full of products that no longer exist.
48 hours or so would be ideal

Hey @mattjis

This is a great idea!

I think right now what you could do is store a createdAt timestamp on the cart, and then inside of your app use useEffect to check the timestamp, and do whatever you need to.

I think this would make a great addition to the library. I'll have a play around and see how we can support this.