valdres 0.2.0-alpha.52 → 0.2.0-alpha.53

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.51";
773
+ var version = "0.2.0-alpha.52";
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 { State } from "./State";
2
- export type SubscribeFn = <V>(state: State<V>, callback: () => void, requireDeepEqualCheckBeforeCallback?: boolean) => () => void;
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.52",
3
+ "version": "0.2.0-alpha.53",
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": "fbc7dd0ea79865876475542baafc0988684b8744"
39
+ "gitHead": "97fd43c4334c52ccef7a4e0aa8e68b7844ef05d6"
40
40
  }