@exodus/atoms 10.2.1 → 10.2.2
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 +6 -0
- package/lib/enhancers/filter.js +10 -8
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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
|
+
## [10.2.2](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@10.2.1...@exodus/atoms@10.2.2) (2026-04-02)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- fix(atoms): resolve promise hanging anti-pattern in filter enhancer (#15780)
|
|
11
|
+
|
|
6
12
|
## [10.2.1](https://github.com/ExodusMovement/exodus-hydra/compare/@exodus/atoms@10.2.0...@exodus/atoms@10.2.1) (2026-04-02)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
package/lib/enhancers/filter.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import makeConcurrent from 'make-concurrent';
|
|
2
2
|
const limitConcurrency = (fn) => makeConcurrent(fn, { concurrency: 1 });
|
|
3
3
|
export default function filter(atom, predicate) {
|
|
4
|
-
const get = limitConcurrency(
|
|
4
|
+
const get = limitConcurrency(async () => {
|
|
5
5
|
const value = await atom.get();
|
|
6
6
|
if (predicate(value)) {
|
|
7
|
-
return
|
|
7
|
+
return value;
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
return new Promise((resolve) => {
|
|
10
|
+
const unsubscribe = atom.observe((value) => {
|
|
11
|
+
if (predicate(value)) {
|
|
12
|
+
unsubscribe();
|
|
13
|
+
resolve(value);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
14
16
|
});
|
|
15
|
-
})
|
|
17
|
+
});
|
|
16
18
|
const observe = (listener) => {
|
|
17
19
|
return atom.observe((value) => {
|
|
18
20
|
if (predicate(value)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/atoms",
|
|
3
|
-
"version": "10.2.
|
|
3
|
+
"version": "10.2.2",
|
|
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",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"provenance": false
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "55540ff3a6815d24d42836269d8a8541289c5e45"
|
|
60
60
|
}
|