Skip to content

This repository serves as a demonstration of best practices and usage patterns for implementing state management in a React application using

Notifications You must be signed in to change notification settings

hossein-rahmati/redux-toolkit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redux Toolkit Sample Code

Welcome to the Redux Toolkit Sample Code repository! This project serves as a demonstration of best practices and usage patterns for implementing state management in a React application using Redux Toolkit

Introduction

Redux Toolkit is a powerful toolset that simplifies and streamlines the development of Redux applications. This sample code showcases the integration of Redux Toolkit in a React application, highlighting key features such as createSlice, createAsyncThunk, and more.

Getting Started

To run the sample code locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/your-username/redux-toolkit-sample.git

  2. Change into the project directory:

    cd redux-toolkit-sample

  3. Install dependencies:

    npm install

  4. Start the development server:

    npm start

This will launch the application in your default web browser at http://localhost:3000.

Features

Counter Feature

  • Increment button to modify a counter value.
  • Utilizes Redux Toolkit's createSlice for reducer and action creation.

Async Data Feature

  • Fetch and display data from a fake API.
  • Utilizes Redux Toolkit's createSlice and createAsyncThunk for handling asynchronous data fetching.

Project Structure

The project structure follows a modular organization for better maintainability:

redux-toolkit-sample/ │ ├── src/ │ ├── componetns/ │ ├── features/ │ │ ├── counter/ │ │ └── user/ │ ├── main.jsx │ ├── App.jsx │ ├── index.css │ └──App.css │ ├── .gitignore ├── package.json └── README.md

Additional Resources

About

This repository serves as a demonstration of best practices and usage patterns for implementing state management in a React application using

Topics

Resources

Stars

Watchers

Forks