New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@inglorious/store

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@inglorious/store - npm Package Compare versions

Comparing version
9.4.0
to
9.5.0
+1
-1
package.json
{
"name": "@inglorious/store",
"version": "9.4.0",
"version": "9.5.0",
"description": "A state manager for real-time, collaborative apps, inspired by game development patterns and compatible with Redux.",

@@ -5,0 +5,0 @@ "author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",

@@ -33,3 +33,2 @@ import { create } from "mutative"

let state, eventMap, incomingEvents, isProcessing
reset()

@@ -54,2 +53,3 @@ const baseStore = {

store._api = api
reset()
return store

@@ -208,2 +208,9 @@

}
if (autoCreateEntities && !state[typeName]) {
notify("add", {
id: typeName,
type: typeName,
})
}
}

@@ -226,26 +233,4 @@

const oldEntities = state ?? {}
const newEntities = augmentEntities(nextState)
let newEntities = augmentEntities(nextState)
if (autoCreateEntities) {
for (const typeName of Object.keys(types)) {
// Check if entity already exists
const hasEntity = Object.values(newEntities).some(
(entity) => entity.type === typeName,
)
if (!hasEntity) {
// No entity for this type → auto-create minimal entity
newEntities[typeName] = {
id: typeName,
type: typeName,
}
}
}
}
state = newEntities
eventMap = new EventMap(types, newEntities)
incomingEvents = []
isProcessing = false
const oldEntityIds = new Set(Object.keys(oldEntities))

@@ -261,9 +246,30 @@ const newEntityIds = new Set(Object.keys(newEntities))

state = oldEntities
eventMap = new EventMap(types, oldEntities)
incomingEvents = []
isProcessing = false
entitiesToDestroy.forEach((id) => {
notify("remove", id)
})
entitiesToCreate.forEach((id) => {
incomingEvents.push({ type: `#${id}:create` })
const entity = newEntities[id]
notify("add", { id, ...entity })
})
entitiesToDestroy.forEach((id) => {
incomingEvents.push({ type: `#${id}:destroy` })
})
if (autoCreateEntities) {
for (const typeName of Object.keys(types)) {
const hasEntity = Object.values(state).some(
(entity) => entity.type === typeName,
)
if (!hasEntity) {
notify("add", {
id: typeName,
type: typeName,
})
}
}
}
}

@@ -270,0 +276,0 @@