@inglorious/store 4.0.1 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/store.js +10 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/store",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.3",
|
|
4
4
|
"description": "A state manager inspired by Redux, but tailored for the specific needs of game development.",
|
|
5
5
|
"author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"mutative": "^1.3.0",
|
|
37
|
-
"@inglorious/utils": "3.5.
|
|
37
|
+
"@inglorious/utils": "3.5.1"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@inglorious/utils": "3.5.
|
|
40
|
+
"@inglorious/utils": "3.5.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"prettier": "^3.6.2",
|
package/src/store.js
CHANGED
|
@@ -67,7 +67,15 @@ export function createStore({
|
|
|
67
67
|
function update() {
|
|
68
68
|
const processedEvents = []
|
|
69
69
|
|
|
70
|
-
state = create(state,
|
|
70
|
+
state = create(state, patcher, {
|
|
71
|
+
enableAutoFreeze: state.entities.game?.devMode,
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
listeners.forEach((onUpdate) => onUpdate())
|
|
75
|
+
|
|
76
|
+
return processedEvents
|
|
77
|
+
|
|
78
|
+
function patcher(draft) {
|
|
71
79
|
while (incomingEvents.length) {
|
|
72
80
|
const event = incomingEvents.shift()
|
|
73
81
|
processedEvents.push(event)
|
|
@@ -118,11 +126,7 @@ export function createStore({
|
|
|
118
126
|
handle?.(draft, event.payload, api)
|
|
119
127
|
})
|
|
120
128
|
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
listeners.forEach((onUpdate) => onUpdate())
|
|
124
|
-
|
|
125
|
-
return processedEvents
|
|
129
|
+
}
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
/**
|