This repository showcases a basic implementation of state management using Zustand, a simple and flexible state management library for React applications.
Zustand is an easy-to-use state management library. It keeps things simple, allowing developers of any level to handle global state without any complications and has very gentle learning curve.
To learn more about Zustand and its features, visit the Zustand documentation.
This project consists of a single-page interface with three main components:
-
Items Section: Displays a list of items with buttons to add them to either the cart or wishlist.
-
Cart Section: Shows items added to the cart, with options to remove individual items or clear the entire cart.
-
Wishlist Section: Displays items added to the wishlist, with options to remove individual items.
The state management and logic for handling items in the cart and wishlist are implemented using Zustand.
To explore this project:
- Clone the repository to your local machine.
- Install dependencies by running
npm install
. - Start the development server with
npm run dev
. - Open your browser and navigate to the prompted port to view the application.
This same project with same functionalities are implemented using other state management libraries like Redux-Toolkit and Recoil. You can find the Redux Toolkit and Recoil versions for comparison:
If you have any suggestions for improvements, feel free to reach out to me.
If you find this project helpful, consider giving it a star.