What would you recommend for cart management
Answered
Anay-208 posted this in #help-forum
Anay-208OP
What would you recommend me to use for managing user caer `
35 Replies
like state management?
@averydelusionalperson like state management?
Anay-208OP
sort of, is there any package or should I make it from scratch only
you're using next.js right?
Anay-208OP
so, is this cart synced to db?
why not cookies? 

Anay-208OP
It'd prefer to store it in local-
@averydelusionalperson why not cookies? <:meow_stare:763826437341839422>
Anay-208OP
cookies have a limited of data
localStorage can have upto 5 MB
I think you won't store more than this no of ids?
Short mackerel
I use Upstash and Neon to control / manage users
Anay-208OP
what if a user tries to bulk Orders?
I'm not looking for paid solutions
I made it from scratch once, it had some bugs
@Anay-208 what if a user tries to bulk Orders?
Short mackerel
could you go in more context
4096 characters are enough IMO
like if each id has three digits
Anay-208OP
each id has around 10-20 digits
+ the size options
Anay-208OP
What do actually most of the people do? do they make it from scratch
most people will use localStorage or cookies
Answer
or state manager
@Anay-208 What would you recommend me to use for managing user caer `
Short mackerel
Zustand, redux
I prefer localStorage or cookies for Next.js
Anay-208OP
so they use localStorage and rest of the functionality from scratch?
yeah, it's not like there is much functionality to do
remove/add an object from an array
and stringify it
Anay-208OP
aight
