The official, opinionated, batteries-included toolset for efficient Redux development
Installations
npm install @reduxjs/toolkit
Developer Guide
Typescript
Yes
Module System
CommonJS, ESM
Node Version
18.18.2
NPM Version
9.8.1
Score
72.8
Supply Chain
98.4
Quality
93.7
Maintenance
100
Vulnerability
100
License
Releases
v2.5.0
Published on 11 Dec 2024
v2.4.0
Published on 28 Nov 2024
v2.3.0
Published on 14 Oct 2024
RTK-Query OpenAPI Codegen v2.0.0
Published on 14 Oct 2024
v2.2.8
Published on 08 Oct 2024
RTK-Query OpenAPI Codegen v1.2.0
Published on 30 Aug 2024
Contributors
Languages
TypeScript (96.87%)
JavaScript (2.61%)
CSS (0.52%)
Developer
Download Statistics
Total Downloads
438,499,146
Last Day
483,753
Last Week
3,588,067
Last Month
16,146,987
Last Year
175,725,780
GitHub Statistics
10,791 Stars
4,191 Commits
1,187 Forks
72 Watching
104 Branches
378 Contributors
Bundle Size
39.29 kB
Minified
13.41 kB
Minified + Gzipped
Package Meta Information
Latest Version
2.5.0
Package Id
@reduxjs/toolkit@2.5.0
Unpacked Size
5.35 MB
Size
1.16 MB
File Count
236
NPM Version
9.8.1
Node Version
18.18.2
Publised On
11 Dec 2024
Total Downloads
Cumulative downloads
Total Downloads
438,499,146
Last day
-32.8%
483,753
Compared to previous day
Last week
-10.3%
3,588,067
Compared to previous week
Last month
2.4%
16,146,987
Compared to previous month
Last year
34.8%
175,725,780
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
4
Peer Dependencies
2
Dev Dependencies
52
Redux Toolkit
The official, opinionated, batteries-included toolset for efficient Redux development
Installation
Create a React Redux App
The recommended way to start new apps with React and Redux Toolkit is by using our official Redux Toolkit + TS template for Vite, or by creating a new Next.js project using Next's with-redux
template.
Both of these already have Redux Toolkit and React-Redux configured appropriately for that build tool, and come with a small example app that demonstrates how to use several of Redux Toolkit's features.
1# Vite with our Redux+TS template 2# (using the `degit` tool to clone and extract the template) 3npx degit reduxjs/redux-templates/packages/vite-template-redux my-app 4 5# Next.js using the `with-redux` template 6npx create-next-app --example with-redux my-app
We do not currently have official React Native templates, but recommend these templates for standard React Native and for Expo:
- https://github.com/rahsheen/react-native-template-redux-typescript
- https://github.com/rahsheen/expo-template-redux-typescript
An Existing App
Redux Toolkit is available as a package on NPM for use with a module bundler or in a Node application:
1# NPM 2npm install @reduxjs/toolkit 3 4# Yarn 5yarn add @reduxjs/toolkit
The package includes a precompiled ESM build that can be used as a <script type="module">
tag directly in the browser.
Documentation
The Redux Toolkit docs are available at https://redux-toolkit.js.org, including API references and usage guides for all of the APIs included in Redux Toolkit.
The Redux core docs at https://redux.js.org includes the full Redux tutorials, as well usage guides on general Redux patterns.
Purpose
The Redux Toolkit package is intended to be the standard way to write Redux logic. It was originally created to help address three common concerns about Redux:
- "Configuring a Redux store is too complicated"
- "I have to add a lot of packages to get Redux to do anything useful"
- "Redux requires too much boilerplate code"
We can't solve every use case, but in the spirit of create-react-app
, we can try to provide some tools that abstract over the setup process and handle the most common use cases, as well as include some useful utilities that will let the user simplify their application code.
Because of that, this package is deliberately limited in scope. It does not address concepts like "reusable encapsulated Redux modules", folder or file structures, managing entity relationships in the store, and so on.
Redux Toolkit also includes a powerful data fetching and caching capability that we've dubbed "RTK Query". It's included in the package as a separate set of entry points. It's optional, but can eliminate the need to hand-write data fetching logic yourself.
What's Included
Redux Toolkit includes these APIs:
configureStore()
: wrapscreateStore
to provide simplified configuration options and good defaults. It can automatically combine your slice reducers, add whatever Redux middleware you supply, includesredux-thunk
by default, and enables use of the Redux DevTools Extension.createReducer()
: lets you supply a lookup table of action types to case reducer functions, rather than writing switch statements. In addition, it automatically uses theimmer
library to let you write simpler immutable updates with normal mutative code, likestate.todos[3].completed = true
.createAction()
: generates an action creator function for the given action type string. The function itself hastoString()
defined, so that it can be used in place of the type constant.createSlice()
: combinescreateReducer()
+createAction()
. Accepts an object of reducer functions, a slice name, and an initial state value, and automatically generates a slice reducer with corresponding action creators and action types.combineSlices()
: combines multiple slices into a single reducer, and allows "lazy loading" of slices after initialisation.createListenerMiddleware()
: lets you define "listener" entries that contain an "effect" callback with additional logic, and a way to specify when that callback should run based on dispatched actions or state changes. A lightweight alternative to Redux async middleware like sagas and observables.createAsyncThunk()
: accepts an action type string and a function that returns a promise, and generates a thunk that dispatchespending/resolved/rejected
action types based on that promisecreateEntityAdapter()
: generates a set of reusable reducers and selectors to manage normalized data in the store- The
createSelector()
utility from the Reselect library, re-exported for ease of use.
For details, see the Redux Toolkit API Reference section in the docs.
RTK Query
RTK Query is provided as an optional addon within the @reduxjs/toolkit
package. It is purpose-built to solve the use case of data fetching and caching, supplying a compact, but powerful toolset to define an API interface layer for your app. It is intended to simplify common cases for loading data in a web application, eliminating the need to hand-write data fetching & caching logic yourself.
RTK Query is built on top of the Redux Toolkit core for its implementation, using Redux internally for its architecture. Although knowledge of Redux and RTK are not required to use RTK Query, you should explore all of the additional global store management capabilities they provide, as well as installing the Redux DevTools browser extension, which works flawlessly with RTK Query to traverse and replay a timeline of your request & cache behavior.
RTK Query is included within the installation of the core Redux Toolkit package. It is available via either of the two entry points below:
1import { createApi } from '@reduxjs/toolkit/query' 2 3/* React-specific entry point that automatically generates 4 hooks corresponding to the defined endpoints */ 5import { createApi } from '@reduxjs/toolkit/query/react'
What's included
RTK Query includes these APIs:
createApi()
: The core of RTK Query's functionality. It allows you to define a set of endpoints describe how to retrieve data from a series of endpoints, including configuration of how to fetch and transform that data. In most cases, you should use this once per app, with "one API slice per base URL" as a rule of thumb.fetchBaseQuery()
: A small wrapper around fetch that aims to simplify requests. Intended as the recommended baseQuery to be used in createApi for the majority of users.<ApiProvider />
: Can be used as a Provider if you do not already have a Redux store.setupListeners()
: A utility used to enable refetchOnMount and refetchOnReconnect behaviors.
See the RTK Query Overview page for more details on what RTK Query is, what problems it solves, and how to use it.
Contributing
Please refer to our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Redux Toolkit.
No vulnerabilities found.
Reason
30 commit(s) and 24 issue activity found in the last 90 days -- score normalized to 10
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
packaging workflow detected
Details
- Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:18
Reason
binaries present in source code
Details
- Warn: binary detected: examples/publish-ci/react-native/android/gradle/wrapper/gradle-wrapper.jar:1
Reason
Found 5/13 approved changesets -- score normalized to 3
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Info: jobLevel 'contents' permission set to 'read': .github/workflows/publish.yml:22
- Warn: no topLevel permission defined: .github/workflows/publish.yml:1
- Warn: no topLevel permission defined: .github/workflows/test-codegen.yml:1
- Warn: no topLevel permission defined: .github/workflows/tests.yml:1
- Info: no jobLevel write permissions found
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/publish.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/size.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/size.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/size.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/size.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:87: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:90: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:97: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:131: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:134: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test-codegen.yml:144: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/test-codegen.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/tests.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:88: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:91: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:100: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:151: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:154: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:168: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:216: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:219: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:230: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:246: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:270: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:273: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:281: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:309: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:312: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tests.yml:320: update your workflow using https://app.stepsecurity.io/secureworkflow/reduxjs/redux-toolkit/tests.yml/master?enable=pin
- Info: 0 out of 33 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 3 third-party GitHubAction dependencies pinned
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 28 are checked with a SAST tool
Reason
80 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-hpx4-r86g-5jrg
- Warn: Project is vulnerable to: GHSA-prr3-c3m5-p7q2
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-434g-2637-qmqr
- Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m
- Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw
- Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p
- Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747
- Warn: Project is vulnerable to: GHSA-4gmj-3p3h-gm8h
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-33f9-j839-rf8h
- Warn: Project is vulnerable to: GHSA-c36v-fmgq-m8hx
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5
- Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp
- Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986 / GHSA-64vr-g452-qvp3
- Warn: Project is vulnerable to: GHSA-c59h-r6p8-q9wc
- Warn: Project is vulnerable to: GHSA-g77x-44xx-532m
- Warn: Project is vulnerable to: GHSA-7gfc-8cq8-jh5f
- Warn: Project is vulnerable to: GHSA-353f-5xf4-qw67
- Warn: Project is vulnerable to: GHSA-c24v-8rfc-w8vw
- Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g
- Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx
- Warn: Project is vulnerable to: GHSA-4w2v-q235-vp99
- Warn: Project is vulnerable to: GHSA-cph5-m8f7-6c5x
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-7gc6-qh9x-w6h8
- Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q
- Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33
- Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959
- Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4
- Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2
- Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v
- Warn: Project is vulnerable to: GHSA-cchq-frgv-rjh5
- Warn: Project is vulnerable to: GHSA-g644-9gfx-q4q4
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
Score
4
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to @reduxjs/toolkit
reduxjs-toolkit-persist
persist and rehydrate redux stores
@didley/reduxjs-toolkit
Extends redux-toolkit's createEntityAdapter with some additional utils
@carlhopf/reduxjs-toolkit
webpack re-packaged @reduxjs/toolkit
@adamldoyle/reduxjs-toolkit-monitored-slice
Allow easy creation of a monitored slice that's compatible with @reduxjs/toolkit. A monitored slice automatically manages the lifecycle of provided data by tracking when it's stale, when it's loading, or when it's available.