valdres 0.2.0-alpha.70 → 0.2.0-alpha.71

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/dist/index.js CHANGED
@@ -631,6 +631,11 @@ var subscribe = (state, callback, requireDeepEqualCheckBeforeCallback, data) =>
631
631
  };
632
632
  };
633
633
 
634
+ // src/lib/isProd.ts
635
+ var isProd2 = () => {
636
+ return true;
637
+ };
638
+
634
639
  // src/lib/setAtoms.ts
635
640
  var setAtoms = (pairs, data) => {
636
641
  const updatedAtoms = [];
@@ -638,9 +643,9 @@ var setAtoms = (pairs, data) => {
638
643
  const currentValue = getState(atom, data);
639
644
  if (!atom.equal(currentValue, value)) {
640
645
  updatedAtoms.push(atom);
646
+ value = setValueInData(atom, value, data);
641
647
  if (atom.onSet)
642
648
  atom.onSet(value, data);
643
- setValueInData(atom, value, data);
644
649
  }
645
650
  }
646
651
  propagateUpdatedAtoms(updatedAtoms, data);
@@ -734,7 +739,11 @@ var transaction = (callback, data, autoCommit = true, parentGetFromTxnOrData) =>
734
739
  if (txnSubscribers.get(atom)?.size) {
735
740
  recursivlyResetTxnSelectorCache(atom, txnSubscribers, txnSelectorCache);
736
741
  }
737
- txnAtomMap.set(atom, value);
742
+ if (isProd2()) {
743
+ txnAtomMap.set(atom, value);
744
+ } else {
745
+ txnAtomMap.set(atom, deepFreeze(value));
746
+ }
738
747
  if (isFamilyAtom(atom)) {
739
748
  const currentKeySet = txnGet(atom.family.__keysAtom);
740
749
  if (!currentKeySet.has(atom.familyKey)) {
@@ -0,0 +1 @@
1
+ export declare const isProd: () => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valdres",
3
- "version": "0.2.0-alpha.70",
3
+ "version": "0.2.0-alpha.71",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Eigil Sagafos"
@@ -36,5 +36,5 @@
36
36
  "access": "public",
37
37
  "registry": "https://registry.npmjs.org/"
38
38
  },
39
- "gitHead": "e30d9cd0edbaee91ec9f25f46f9e7a27baf52312"
39
+ "gitHead": "2f1845dd9e2b0856efb64f5d1eb73fac3d8fa161"
40
40
  }