@exodus/available-assets 4.1.0 → 5.0.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 +14 -0
- package/index.js +2 -0
- package/package.json +5 -4
- package/plugins/index.js +32 -0
- package/redux/index.js +1 -1
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
|
+
## [5.0.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/available-assets@4.1.0...@exodus/available-assets@5.0.0) (2023-08-25)
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- remove store and actions from setup redux (#3575)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- add atom observer in available-assets plugin ([#3553](https://github.com/ExodusMovement/exodus-hydra/issues/3553)) ([26d769c](https://github.com/ExodusMovement/exodus-hydra/commit/26d769c0536d4c0f99b5ea4ca5a7f4123ba16d6f))
|
|
15
|
+
|
|
16
|
+
### Code Refactoring
|
|
17
|
+
|
|
18
|
+
- remove store and actions from setup redux ([#3575](https://github.com/ExodusMovement/exodus-hydra/issues/3575)) ([64fa4a6](https://github.com/ExodusMovement/exodus-hydra/commit/64fa4a6c2b69409a81ab140adbdf84646f1be73a))
|
|
19
|
+
|
|
6
20
|
## [4.1.0](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/available-assets@4.0.0...@exodus/available-assets@4.1.0) (2023-08-22)
|
|
7
21
|
|
|
8
22
|
### Features
|
package/index.js
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
} from './atoms'
|
|
5
5
|
import availableAssetsModuleDefinition from './module'
|
|
6
6
|
import availableAssetsApiDefinition from './api'
|
|
7
|
+
import availableAssetsPluginDefinition from './plugins'
|
|
7
8
|
|
|
8
9
|
const availableAssets = () => ({
|
|
9
10
|
id: 'availableAssets',
|
|
@@ -15,6 +16,7 @@ const availableAssets = () => ({
|
|
|
15
16
|
{ definition: availableAssetNamesAtomDefinition },
|
|
16
17
|
{ definition: availableAssetNamesWithoutParentCombinedAtomDefinition },
|
|
17
18
|
{ definition: availableAssetsApiDefinition },
|
|
19
|
+
{ definition: availableAssetsPluginDefinition },
|
|
18
20
|
],
|
|
19
21
|
})
|
|
20
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/available-assets",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Tracks supported/available assets, i.e. assets that the user can potentially enable via the UI",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"author": "Exodus Movement Inc.",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"atoms",
|
|
16
16
|
"api",
|
|
17
17
|
"redux",
|
|
18
|
+
"plugins",
|
|
18
19
|
"README.md",
|
|
19
20
|
"CHANGELOG.md",
|
|
20
21
|
"!**/__tests__/**"
|
|
@@ -37,13 +38,13 @@
|
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
40
|
"@exodus/assets-base": "^8.1.10",
|
|
40
|
-
"@exodus/assets-feature": "^1.
|
|
41
|
+
"@exodus/assets-feature": "^1.3.0",
|
|
41
42
|
"@exodus/enabled-assets": "^6.0.2",
|
|
42
|
-
"@exodus/redux-dependency-injection": "^
|
|
43
|
+
"@exodus/redux-dependency-injection": "^2.0.1",
|
|
43
44
|
"eslint": "^8.44.0",
|
|
44
45
|
"jest": "^29.1.2",
|
|
45
46
|
"jest-when": "^3.6.0",
|
|
46
47
|
"redux": "^4.2.1"
|
|
47
48
|
},
|
|
48
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "c675747e01ce376e8b590d72b4f6d97c5f8a6c6a"
|
|
49
50
|
}
|
package/plugins/index.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createAtomObserver } from '@exodus/atoms'
|
|
2
|
+
|
|
3
|
+
const createAvailableAssetsPlugin = ({ port, availableAssetNamesAtom }) => {
|
|
4
|
+
const availableAssetNamesAtomObserver = createAtomObserver({
|
|
5
|
+
port,
|
|
6
|
+
atom: availableAssetNamesAtom,
|
|
7
|
+
event: 'availableAssetNames',
|
|
8
|
+
})
|
|
9
|
+
availableAssetNamesAtomObserver.register()
|
|
10
|
+
|
|
11
|
+
const onLoad = () => {
|
|
12
|
+
availableAssetNamesAtomObserver.start()
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const onStop = () => {
|
|
16
|
+
availableAssetNamesAtomObserver.unregister()
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
onLoad,
|
|
21
|
+
onStop,
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const availableAssetsPluginDefinition = {
|
|
26
|
+
id: 'availableAssetsPlugin',
|
|
27
|
+
type: 'plugin',
|
|
28
|
+
factory: createAvailableAssetsPlugin,
|
|
29
|
+
dependencies: ['port', 'availableAssetNamesAtom'],
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default availableAssetsPluginDefinition
|
package/redux/index.js
CHANGED
|
@@ -7,7 +7,7 @@ const availableAssetsReduxDefinition = {
|
|
|
7
7
|
type: 'redux-module',
|
|
8
8
|
initialState,
|
|
9
9
|
eventReducers: {
|
|
10
|
-
|
|
10
|
+
availableAssetNames: (state, availableAssetNames) => ({
|
|
11
11
|
...state,
|
|
12
12
|
data: new Set(availableAssetNames),
|
|
13
13
|
}),
|