adefrutoscasado / redux-toolkit-example-project

Some examples to learn Redux Toolkit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Redux Toolkit project example



Getting Started

To get a local copy up and running follow these simple steps.

Installation

  1. Clone the repo
    git clone https://github.com/adefrutoscasado/redux-toolkit-example-project
  2. Install NPM packages
    npm install
  3. Start the mock server
    npm run mock-server:dev
  4. Start the frontend application
    npm start

Examples

Login

  • JWT refresh token strategy.
  • Use of mutex to avoid repeating token refresh requests.
  • Use of createAsyncThunk(), isAsyncThunkAction(), isPending(), isRejected(), isFulfilled(), createAction(), isAnyOf() utils.
  • Use of unwrap().

Counter (Redux toolkit original example)

  • Use of createSlice(), createAsyncThunk().

Todo

  • Todo list.
  • Use of createEntityAdapter(), its sortComparer and its CRUD operations.
  • Use of prepare() function.

Blog

  • A blog integrated with a mock server.
  • Use of createApi().
  • Use of createEntityAdapter().
  • Tag invalidation.
  • Implementation of normal updates and optimistic updates.

Pets

  • Displays pets of persons.
  • Use of createApi().
  • Use of createEntityAdapter().
  • Get selectors dinamically based on the arguments you used in the query of createApi().

About

Some examples to learn Redux Toolkit


Languages

Language:TypeScript 76.1%Language:JavaScript 14.9%Language:CSS 6.0%Language:HTML 2.9%