@exodus/ui-config 3.3.0 → 3.5.0

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,18 @@
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
+ ## [3.5.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/ui-config@3.4.0...@exodus/ui-config@3.5.0) (2024-04-16)
7
+
8
+ ### Features
9
+
10
+ - emit ui config values on start ([#6516](https://github.com/ExodusMovement/exodus-hydra/issues/6516)) ([5f3c565](https://github.com/ExodusMovement/exodus-hydra/commit/5f3c56528cbc712c5ad032ce0f9c63d9625032f0))
11
+
12
+ ## [3.4.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/ui-config@3.3.0...@exodus/ui-config@3.4.0) (2024-01-08)
13
+
14
+ ### Features
15
+
16
+ - **@exodus/ui-config:** add ability to prevent persist atoms from clearing ([#5274](https://github.com/ExodusMovement/exodus-hydra/issues/5274)) ([eb503a5](https://github.com/ExodusMovement/exodus-hydra/commit/eb503a5d24a681813cb08c02ba871cdcaba63933))
17
+
6
18
  ## [3.3.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/ui-config@3.2.0...@exodus/ui-config@3.3.0) (2023-11-13)
7
19
 
8
20
  ### Features
package/api/index.js CHANGED
@@ -15,7 +15,6 @@ const createUiConfigApiDefinition = ({ configValues }) => {
15
15
  },
16
16
  dependencies: atomIds,
17
17
  },
18
- writesAtoms: atomIds,
19
18
  }
20
19
  }
21
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ui-config",
3
- "version": "3.3.0",
3
+ "version": "3.5.0",
4
4
  "description": "Helper for storing various UI-specific settings/config.",
5
5
  "author": "Exodus Movement Inc.",
6
6
  "license": "UNLICENSED",
@@ -25,21 +25,19 @@
25
25
  "!**/__tests__/**"
26
26
  ],
27
27
  "scripts": {
28
- "lint": "eslint . --ignore-path ../../.gitignore",
28
+ "lint": "run -T eslint . --ignore-path ../../.gitignore",
29
29
  "lint:fix": "yarn lint --fix",
30
- "test": "jest"
30
+ "test": "run -T jest"
31
31
  },
32
32
  "dependencies": {
33
- "@exodus/atoms": "^6.0.1",
33
+ "@exodus/atoms": "^7.0.5",
34
34
  "@exodus/basic-utils": "^2.1.0",
35
35
  "@exodus/formatting": "^1.2.1",
36
36
  "lodash": "^4.17.21"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@exodus/redux-dependency-injection": "^3.0.0",
40
- "eslint": "^8.44.0",
41
- "jest": "^29.1.2",
42
40
  "redux": "^4.2.1"
43
41
  },
44
- "gitHead": "de55f8221ff7aaad1386858dbccd93951f7e7004"
42
+ "gitHead": "53896d0f16872275b445bb9ad3919cdeedbd76e2"
45
43
  }
package/plugin/index.js CHANGED
@@ -4,14 +4,18 @@ const createUiConfigPluginDefinition = ({ configValues }) => {
4
4
  const atomIds = configValues.map((v) => v.atomId)
5
5
 
6
6
  const factory = ({ port, ...atoms }) => {
7
- const atomObservers = configValues.map(({ id, atomId }) =>
8
- createAtomObserver({ port, atom: atoms[atomId], event: id })
9
- )
7
+ const items = configValues.map(({ id, atomId, ...config }) => ({
8
+ atom: atoms[atomId],
9
+ observer: createAtomObserver({ port, atom: atoms[atomId], event: id }),
10
+ config,
11
+ }))
10
12
 
11
13
  return {
12
- onLoad: () => atomObservers.forEach((observer) => observer.start()),
13
- onClear: () => Promise.all(Object.values(atoms).map((atom) => atom.set(undefined))),
14
- onStop: () => atomObservers.forEach((observer) => observer.unregister()),
14
+ onLoad: () => items.forEach(({ observer }) => observer.start()),
15
+ onStart: () => items.forEach(({ observer }) => observer.start()),
16
+ onClear: () =>
17
+ Promise.all(items.map(({ atom, config }) => (config.persist ? null : atom.set(undefined)))),
18
+ onStop: () => items.forEach(({ observer }) => observer.unregister()),
15
19
  }
16
20
  }
17
21
 
@@ -22,7 +26,6 @@ const createUiConfigPluginDefinition = ({ configValues }) => {
22
26
  factory,
23
27
  dependencies: ['port', ...atomIds],
24
28
  },
25
- writesAtoms: atomIds,
26
29
  }
27
30
  }
28
31