@inglorious/store 4.0.0 → 4.0.1

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/README.md CHANGED
@@ -31,7 +31,7 @@ The state management is built on a few simple principles:
31
31
  - The store processes events by first applying behaviors defined on an entity's type, and then running the logic in the systems.
32
32
  - An `update` event with a `dt` (delta time) payload is automatically dispatched on every `store.update()` call, making it suitable for a game loop.
33
33
 
34
- 4. **Immutability**: The state is immutable. Updates are handled internally by **[Immer](https://immerjs.github.io/immer/)**, so you can "mutate" the state directly within a type's or system's behavior function, and a new, immutable state will be produced.
34
+ 4. **Immutability**: The state is immutable. Updates are handled internally by **[Mutative](https://mutative.js.org/)**, so you can "mutate" the state directly within a type's or system's behavior function, and a new, immutable state will be created.
35
35
 
36
36
  ---
37
37
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inglorious/store",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
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",
@@ -33,13 +33,17 @@
33
33
  "access": "public"
34
34
  },
35
35
  "dependencies": {
36
- "immer": "^10.1.1",
37
- "@inglorious/utils": "3.1.0"
36
+ "mutative": "^1.3.0",
37
+ "@inglorious/utils": "3.5.0"
38
+ },
39
+ "peerDependencies": {
40
+ "@inglorious/utils": "3.5.0"
38
41
  },
39
42
  "devDependencies": {
40
43
  "prettier": "^3.6.2",
41
44
  "vite": "^7.1.3",
42
- "vitest": "^1.6.1"
45
+ "vitest": "^1.6.1",
46
+ "@inglorious/eslint-config": "1.0.0"
43
47
  },
44
48
  "engines": {
45
49
  "node": ">= 22"
package/src/store.js CHANGED
@@ -1,4 +1,4 @@
1
- import { produce } from "immer"
1
+ import { create } from "mutative"
2
2
 
3
3
  import { createApi } from "./api.js"
4
4
  import { augmentEntities, augmentEntity } from "./entities.js"
@@ -67,7 +67,7 @@ export function createStore({
67
67
  function update() {
68
68
  const processedEvents = []
69
69
 
70
- state = produce(state, (draft) => {
70
+ state = create(state, (draft) => {
71
71
  while (incomingEvents.length) {
72
72
  const event = incomingEvents.shift()
73
73
  processedEvents.push(event)