Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@reduxjs/toolkit

Package Overview
Dependencies
Maintainers
5
Versions
98
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reduxjs/toolkit - npm Package Compare versions

Comparing version 2.2.4 to 2.2.5

4

package.json
{
"name": "@reduxjs/toolkit",
"version": "2.2.4",
"version": "2.2.5",
"description": "The official, opinionated, batteries-included toolset for efficient Redux development",

@@ -106,3 +106,3 @@ "author": "Mark Erikson <mark@isquaredsoftware.com>",

"lint": "eslint src examples",
"test": "vitest --run --typecheck",
"test": "vitest --typecheck --run ",
"test:watch": "vitest --watch",

@@ -109,0 +109,0 @@ "type-tests": "yarn tsc -p tsconfig.test.json --noEmit",

@@ -8,2 +8,3 @@ import type { EntityAdapter, EntityState } from '../models'

nanoid,
PayloadAction,
} from '@reduxjs/toolkit'

@@ -787,2 +788,26 @@ import type { BookModel } from './fixtures/book'

it('should not throw an Immer `current` error when `state.ids` is a plain array', () => {
const book1: BookModel = { id: 'a', title: 'First' }
const initialState = adapter.getInitialState()
const withItems = adapter.addMany(initialState, [book1])
const booksSlice = createSlice({
name: 'books',
initialState,
reducers: {
testCurrentBehavior(state, action: PayloadAction<BookModel>) {
// Will overwrite `state.ids` with a plain array
adapter.removeAll(state)
// will call `splitAddedUpdatedEntities` and call `current(state.ids)`
adapter.upsertMany(state, [book1])
},
},
})
booksSlice.reducer(
initialState,
booksSlice.actions.testCurrentBehavior(book1),
)
})
describe('can be used mutably when wrapped in createNextState', () => {

@@ -789,0 +814,0 @@ test('removeAll', () => {

@@ -50,3 +50,3 @@ import { current, isDraft } from 'immer'

const existingIdsArray = current(state.ids) as Id[]
const existingIdsArray = getCurrent(state.ids) as Id[]
const existingIds = new Set<Id>(existingIdsArray)

@@ -53,0 +53,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc