Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 8, 2024 via pnpm

@reduxjs/toolkit 1.9.5

The official, opinionated, batteries-included toolset for efficient Redux development
Package summary
Share
0
issues
1
license
7
MIT
Package created
13 Nov 2019
Version published
18 Apr 2023
Maintainers
5
Total deps
7
Direct deps
4
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
7 Packages, Including:
@babel/runtime@7.24.5
@reduxjs/toolkit@1.9.5
immer@9.0.21
redux-thunk@2.4.2
redux@4.2.1
regenerator-runtime@0.14.1
reselect@4.1.8
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
ⓘ This is a list of @reduxjs/toolkit 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
immer9.0.21238.18 kBMIT
prod
redux-thunk2.4.29.03 kBMIT
prod
redux4.2.133.92 kBMIT
prod peer
reselect4.1.828.75 kBMIT
prod

Visualizations

Frequently Asked Questions

What does @reduxjs/toolkit do?

The @reduxjs/toolkit is the official, opinionated, and batteries-included toolset designed for efficient Redux development. It aims to simplify Redux logic, addressing common concerns about Redux's complexity, the need for additional packages to make Redux useful, and the boilerplate code required by Redux. The toolkit includes powerful features like auto-merging of reducers, Redux middleware addition, chainable action creators, and normalized data management in the Redux store. It also comes with a separate powerful data fetching and caching utility dubbed “RTK Query,” which eliminates the need to write data fetching logic from scratch.

How do you use @reduxjs/toolkit?

To use the @reduxjs/toolkit, you first need to install it into your project using NPM or Yarn:

# Using NPM
npm install @reduxjs/toolkit

# Using Yarn
yarn add @reduxjs/toolkit

Once installed, you can use it in your Redux store configuration. Here are some examples:

Redux Store with @reduxjs/toolkit:

import { configureStore } from '@reduxjs/toolkit'
import rootReducer from './rootReducer'

const store = configureStore({
  reducer: rootReducer
})

export default store;

Action creation with @reduxjs/toolkit:

import { createAction } from '@reduxjs/toolkit'

export const increment = createAction('counter/increment')

Reducer creation with @reduxjs/toolkit:

import { createReducer } from '@reduxjs/toolkit'
import { increment } from './counterActions'

const counter = createReducer(0, {
  [increment]: (state, action) => state + action.payload,
})

export default counter;

The RTK Query can specifically be used for data fetching and caching scenarios:

import { createApi } from '@reduxjs/toolkit/query/react'
import { fetchBaseQuery } from '@reduxjs/toolkit/query'

export const api = createApi({
  baseQuery: fetchBaseQuery({ baseUrl: '/api' }),
  endpoints: (builder) => ({
    getUser: builder.query({
      query: (name) => `user/${name}`,
    }),
  }),
})

export const { useGetUserQuery } = api

Note that this barely scratches the surface of what can be done with @reduxjs/toolkit.

Where are the @reduxjs/toolkit docs?

The official documentation for @reduxjs/toolkit is available on the Redux Toolkit website at https://redux-toolkit.js.org. This includes more detailed explanations and examples of the toolkit's API methods, information about its purpose and what it includes, an overview and guide to using the included RTK Query tool, and more. The docs are comprehensive and provide a good grounding in how to use the toolkit effectively in your Redux development.