valdres 0.2.0-alpha.52 → 0.2.0-alpha.54
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
|
@@ -491,12 +491,12 @@ var subscribe = (state, callback, requireDeepEqualCheckBeforeCallback, data) =>
|
|
|
491
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
|
-
callback = () => {
|
|
494
|
+
callback = (arg) => {
|
|
495
495
|
if (parentUnsubscribe) {
|
|
496
496
|
parentUnsubscribe();
|
|
497
497
|
parentUnsubscribe = undefined;
|
|
498
498
|
}
|
|
499
|
-
originalCallback();
|
|
499
|
+
originalCallback(arg);
|
|
500
500
|
};
|
|
501
501
|
} else if (!data.values.has(state) && isAtom(state)) {
|
|
502
502
|
initAtom(state, data);
|
|
@@ -770,7 +770,7 @@ var store = (id) => {
|
|
|
770
770
|
return storeFromStoreData(data);
|
|
771
771
|
};
|
|
772
772
|
// package.json
|
|
773
|
-
var version = "0.2.0-alpha.
|
|
773
|
+
var version = "0.2.0-alpha.53";
|
|
774
774
|
|
|
775
775
|
// src/globalStore.ts
|
|
776
776
|
if (globalThis.__valdres__) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { Family } from "../types/Family";
|
|
2
2
|
import type { State } from "../types/State";
|
|
3
3
|
import type { StoreData } from "../types/StoreData";
|
|
4
|
-
export declare const subscribe: <V>(state: State<V> | Family<V>, callback: () => void, requireDeepEqualCheckBeforeCallback: boolean, data: StoreData) => () => void;
|
|
4
|
+
export declare const subscribe: <V>(state: State<V> | Family<V>, callback: (arg?: any) => void, requireDeepEqualCheckBeforeCallback: boolean, data: StoreData) => () => void;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Atom } from "./Atom";
|
|
2
|
+
import type { Family } from "./Family";
|
|
3
|
+
import type { Selector } from "./Selector";
|
|
4
|
+
type UnsuscribeFn = () => void;
|
|
5
|
+
export type SubscribeFn = {
|
|
6
|
+
<V, K>(state: Family<K, V>, callback: (arg: K) => void, requireDeepEqualCheckBeforeCallback?: boolean): UnsuscribeFn;
|
|
7
|
+
<V>(state: Atom<V> | Selector<V>, callback: () => void, requireDeepEqualCheckBeforeCallback?: boolean): UnsuscribeFn;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
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.54",
|
|
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": "004a507782c3fefd0bde0e9e43595838e5957caa"
|
|
40
40
|
}
|