teamplay 0.2.1 → 0.2.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "teamplay",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Full-stack signals ORM with multiplayer",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -23,12 +23,12 @@
23
23
  },
24
24
  "dependencies": {
25
25
  "@nx-js/observer-util": "^4.1.3",
26
- "@teamplay/backend": "^0.2.1",
27
- "@teamplay/cache": "^0.2.1",
28
- "@teamplay/channel": "^0.2.1",
29
- "@teamplay/debug": "^0.2.1",
30
- "@teamplay/schema": "^0.2.1",
31
- "@teamplay/utils": "^0.2.1",
26
+ "@teamplay/backend": "^0.2.3",
27
+ "@teamplay/cache": "^0.2.3",
28
+ "@teamplay/channel": "^0.2.3",
29
+ "@teamplay/debug": "^0.2.3",
30
+ "@teamplay/schema": "^0.2.3",
31
+ "@teamplay/utils": "^0.2.3",
32
32
  "diff-match-patch": "^1.0.5",
33
33
  "events": "^3.3.0",
34
34
  "json0-ot-diff": "^1.1.2",
@@ -63,5 +63,5 @@
63
63
  ]
64
64
  },
65
65
  "license": "MIT",
66
- "gitHead": "4b4a3de5f145338b78de3cf2f461b6824ab8163f"
66
+ "gitHead": "3bed63304ff5ae506931e076b07c772ec5951509"
67
67
  }
@@ -85,7 +85,7 @@ export default function convertToObserver (BaseComponent, {
85
85
 
86
86
  // clean up observer on unmount
87
87
  useUnmount(() => {
88
- destroyRef.current('useUnmount()')
88
+ destroyRef.current?.('useUnmount()')
89
89
  })
90
90
 
91
91
  return reactionRef.current(...args)
@@ -8,6 +8,10 @@ export default function setDiffDeep (existing, updated) {
8
8
  return updated
9
9
  }
10
10
 
11
+ // If the referenced value is the same it means that nothing has changed
12
+ // so we just return the original reference
13
+ if (existing === updated) return existing
14
+
11
15
  // Handle arrays
12
16
  if (Array.isArray(updated)) {
13
17
  existing.length = updated.length
@@ -19,9 +23,7 @@ export default function setDiffDeep (existing, updated) {
19
23
 
20
24
  // Handle non-plain objects - just return them as-is to fully overwrite
21
25
  // and don't try to update an old object in-place
22
- if (!isPlainObject(updated)) {
23
- return updated
24
- }
26
+ if (!isPlainObject(updated)) return updated
25
27
 
26
28
  // Handle objects
27
29
  for (const key in existing) {