valdres 0.2.0-alpha.68 → 0.2.0-alpha.69

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
@@ -146,14 +146,15 @@ var setAtom = (atom, newValue, data, skipOnSet = false) => {
146
146
  }
147
147
  if (atom.equal(currentValue, newValue))
148
148
  return newValue;
149
- data.values.set(atom, newValue);
149
+ const frozenNewValue = newValue;
150
+ data.values.set(atom, frozenNewValue);
150
151
  if (atom.onSet && !skipOnSet)
151
- atom.onSet(newValue, data);
152
+ atom.onSet(frozenNewValue, data);
152
153
  if (currentValue?.__isEmptyAtomPromise__) {
153
- currentValue.__resolveEmptyAtomPromise__(newValue);
154
+ currentValue.__resolveEmptyAtomPromise__(frozenNewValue);
154
155
  }
155
156
  propagateUpdatedAtoms([atom], data);
156
- return newValue;
157
+ return frozenNewValue;
157
158
  };
158
159
 
159
160
  // src/lib/initAtom.ts
@@ -1,3 +1,3 @@
1
1
  import type { Atom } from "../types/Atom";
2
2
  import type { StoreData } from "../types/StoreData";
3
- export declare const setAtom: <Value = any>(atom: Atom<Value>, newValue: Value | ((currentValue: Value) => Value), data: StoreData, skipOnSet?: boolean) => Value;
3
+ export declare const setAtom: <Value = any>(atom: Atom<Value>, newValue: Value | ((currentValue: Value) => Value), data: StoreData, skipOnSet?: boolean) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valdres",
3
- "version": "0.2.0-alpha.68",
3
+ "version": "0.2.0-alpha.69",
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": "81c34343833ad6b9755b0e7ada7f561206974373"
39
+ "gitHead": "302cb73fee8410a225d7c088211fc32520d79b3d"
40
40
  }