valdres 0.2.0-alpha.50 → 0.2.0-alpha.52
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
|
@@ -488,7 +488,7 @@ var initSubscribers = (state, data) => {
|
|
|
488
488
|
};
|
|
489
489
|
var subscribe = (state, callback, requireDeepEqualCheckBeforeCallback, data) => {
|
|
490
490
|
let parentUnsubscribe;
|
|
491
|
-
if ("parent" in data && !data.values.has(state) && isAtom(state)) {
|
|
491
|
+
if ("parent" in data && (!data.values.has(state) && isAtom(state) || isAtomFamily(state))) {
|
|
492
492
|
const originalCallback = callback;
|
|
493
493
|
parentUnsubscribe = subscribe(state, originalCallback, requireDeepEqualCheckBeforeCallback, data.parent);
|
|
494
494
|
callback = () => {
|
|
@@ -694,7 +694,8 @@ var transaction = (callback, data, autoCommit = true) => {
|
|
|
694
694
|
} else {
|
|
695
695
|
throw new Error(`Scope '${scopeId}' not found. Registered scopes: ${Object.keys(data.scopes).join(", ")}`);
|
|
696
696
|
}
|
|
697
|
-
}
|
|
697
|
+
},
|
|
698
|
+
data
|
|
698
699
|
});
|
|
699
700
|
if (autoCommit)
|
|
700
701
|
commit();
|
|
@@ -769,7 +770,7 @@ var store = (id) => {
|
|
|
769
770
|
return storeFromStoreData(data);
|
|
770
771
|
};
|
|
771
772
|
// package.json
|
|
772
|
-
var version = "0.2.0-alpha.
|
|
773
|
+
var version = "0.2.0-alpha.51";
|
|
773
774
|
|
|
774
775
|
// src/globalStore.ts
|
|
775
776
|
if (globalThis.__valdres__) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { GetValue } from "./GetValue";
|
|
2
2
|
import type { ResetAtom } from "./ResetAtom";
|
|
3
3
|
import type { SetAtom } from "./SetAtom";
|
|
4
|
+
import type { StoreData } from "./StoreData";
|
|
4
5
|
import type { TransactionFn } from "./TransactionFn";
|
|
5
6
|
export type TransactionInterface = {
|
|
6
7
|
set: SetAtom;
|
|
@@ -8,4 +9,5 @@ export type TransactionInterface = {
|
|
|
8
9
|
reset: ResetAtom;
|
|
9
10
|
commit: () => void;
|
|
10
11
|
scope: <Callback extends TransactionFn>(scopeId: string, callback: Callback) => ReturnType<Callback>;
|
|
12
|
+
data: StoreData;
|
|
11
13
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valdres",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.52",
|
|
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": "
|
|
39
|
+
"gitHead": "fbc7dd0ea79865876475542baafc0988684b8744"
|
|
40
40
|
}
|