@adbl/cells 0.0.7 → 0.0.9

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.
Files changed (2) hide show
  1. package/library/classes.js +17 -3
  2. package/package.json +1 -1
@@ -413,7 +413,10 @@ export class Cell {
413
413
  []
414
414
  );
415
415
  } else {
416
- computedCell.setValue(computedFn());
416
+ const newValue = computedFn();
417
+ const isSameValue = deepEqual(computedCell.value, newValue);
418
+ computedCell.setValue(newValue);
419
+ if (isSameValue) continue;
417
420
  }
418
421
  computedCell.update();
419
422
  }
@@ -587,9 +590,11 @@ export class Cell {
587
590
  return value instanceof Cell
588
591
  ? Cell.flatten(value.wvalue)
589
592
  : Array.isArray(value)
590
- ? Cell.flattenArray(value)
593
+ ? // @ts-ignore:
594
+ Cell.flattenArray(value)
591
595
  : value instanceof Object
592
- ? Cell.flattenObject(value)
596
+ ? // @ts-ignore:
597
+ Cell.flattenObject(value)
593
598
  : value;
594
599
  };
595
600
 
@@ -913,6 +918,15 @@ function deepEqual(a, b) {
913
918
  )
914
919
  return false;
915
920
 
921
+ if (a instanceof Date) {
922
+ if (!(b instanceof Date)) {
923
+ return false;
924
+ }
925
+ if (a.getTime() !== b.getTime()) {
926
+ return false;
927
+ }
928
+ }
929
+
916
930
  if (Array.isArray(a)) {
917
931
  const aLength = a.length;
918
932
  if (!Array.isArray(b) || aLength !== b.length) return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adbl/cells",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "A simple implementation of reactive updates for JavaScript",
5
5
  "main": "index.js",
6
6
  "private": false,