@exodus/atoms 7.5.1 → 7.6.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/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [7.6.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@7.6.0...@exodus/atoms@7.6.1) (2024-07-09)
7
+
8
+ **Note:** Version bump only for package @exodus/atoms
9
+
10
+ ## [7.6.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@7.5.1...@exodus/atoms@7.6.0) (2024-07-05)
11
+
12
+ ### Features
13
+
14
+ - use safe stringify ([#7653](https://github.com/ExodusMovement/exodus-hydra/issues/7653)) ([a3d922d](https://github.com/ExodusMovement/exodus-hydra/commit/a3d922d48911d963361b896f6bcefa1dc9e255aa))
15
+
16
+ ### Bug Fixes
17
+
18
+ - use default import from lodash ([#7611](https://github.com/ExodusMovement/exodus-hydra/issues/7611)) ([2e83743](https://github.com/ExodusMovement/exodus-hydra/commit/2e8374308f290e24f22e8e41b99be7b7a83d6365))
19
+
6
20
  ## [7.5.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@7.5.0...@exodus/atoms@7.5.1) (2024-07-02)
7
21
 
8
22
  **Note:** Version bump only for package @exodus/atoms
@@ -4,7 +4,7 @@ const { isEqual } = lodash;
4
4
  const dedupe = (atom) => {
5
5
  const set = (value) => {
6
6
  if (value === undefined)
7
- return atom.set(value);
7
+ return atom.reset();
8
8
  return atom.set(async (previous) => {
9
9
  const newValue = isSetter(value) ? await value(previous) : value;
10
10
  return isEqual(previous, newValue) ? previous : newValue;
@@ -1,10 +1,11 @@
1
1
  import assert from 'minimalistic-assert';
2
2
  import lodash from 'lodash';
3
+ import stringify from 'json-stringify-safe';
3
4
  const { isEqual: deepEqual } = lodash;
4
5
  const STRINGIFY_LIMIT = 1000;
5
6
  const limitedStringify = (obj, limit = STRINGIFY_LIMIT) => {
6
7
  let count = 0;
7
- return JSON.stringify(obj, (_, value) => {
8
+ return stringify(obj, (_, value) => {
8
9
  if (count > limit) {
9
10
  return;
10
11
  }
@@ -1,11 +1,10 @@
1
- import EventEmitter from 'events/';
1
+ import EventEmitter from 'eventemitter3';
2
2
  import fromEventEmitter from '../event-emitter.js';
3
3
  import pDefer from 'p-defer';
4
4
  const createAtomMock = (options = {}) => {
5
5
  const { defaultValue } = options;
6
6
  let latestValue = defaultValue;
7
7
  const emitter = new EventEmitter();
8
- emitter.setMaxListeners(Number.POSITIVE_INFINITY);
9
8
  const initialized = pDefer();
10
9
  const get = async () => {
11
10
  if (!('defaultValue' in options)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/atoms",
3
- "version": "7.5.1",
3
+ "version": "7.6.1",
4
4
  "description": "Abstraction for encapsulating a piece of data behind a simple unified interface: get, set, observe",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -31,7 +31,8 @@
31
31
  "@exodus/basic-utils": "^2.5.2",
32
32
  "@exodus/storage-interface": "^1.0.0",
33
33
  "delay": "^5.0.0",
34
- "events": "^3.3.0",
34
+ "eventemitter3": "^4.0.7",
35
+ "json-stringify-safe": "^5.0.1",
35
36
  "lodash": "^4.17.21",
36
37
  "make-concurrent": ">=4 <6",
37
38
  "minimalistic-assert": "^1.0.1",
@@ -43,8 +44,10 @@
43
44
  "@exodus/remote-config": "^2.4.0",
44
45
  "@exodus/storage-memory": "^2.1.1",
45
46
  "@types/jest": "^29.5.11",
47
+ "@types/json-stringify-safe": "^5.0.3",
46
48
  "@types/lodash": "^4.14.200",
47
- "@types/minimalistic-assert": "^1.0.2"
49
+ "@types/minimalistic-assert": "^1.0.2",
50
+ "events": "^3.3.0"
48
51
  },
49
- "gitHead": "cc4ffeeeef57936f7396058959fa986bb7cd10a2"
52
+ "gitHead": "4d0f338fc17d176f1293b54fc881914c62f0cfce"
50
53
  }