@webkrafters/react-observable-context 4.1.1 → 4.1.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.
@@ -16,7 +16,7 @@ declare function useStore<T extends import("../../../types").State>(prehooks: Pr
16
16
  [propertyPaths: string]: Readonly<any>;
17
17
  };
18
18
  resetState: (propertyPaths?: string[]) => void;
19
- setState: (changes: import("../../../types").UpdatePayload<import("../../../types").PartialState<T>>) => void;
19
+ setState: (changes: import("../../../types").Changes<T>) => void;
20
20
  state: T;
21
21
  subscribe: (listener: import("../../../types").Listener<T>) => VoidFunction;
22
22
  unlinkCache: (clientId: string) => void;
@@ -123,7 +123,7 @@ export type StoreRef<T extends import("../types").State> = {
123
123
  getState: () => T;
124
124
  } & {
125
125
  resetState: (propertyPaths?: string[]) => void;
126
- setState: (changes: import("../types").UpdatePayload<import("../types").PartialState<T>>) => void;
126
+ setState: (changes: import("../types").Changes<T>) => void;
127
127
  subscribe: (listener: import("../types").Listener<T>) => VoidFunction;
128
128
  };
129
129
  export type State = import("../types").State;
@@ -138,7 +138,7 @@ export type StoreInternal<T extends import("../types").State> = import("../types
138
138
  export type PartialStore<T extends import("../types").State> = {
139
139
  data?: import("../types").Data;
140
140
  resetState?: (propertyPaths?: string[]) => void;
141
- setState?: (changes: import("../types").UpdatePayload<import("../types").PartialState<T>>) => void;
141
+ setState?: (changes: import("../types").Changes<T>) => void;
142
142
  };
143
143
  export type Store<T extends import("../types").State> = import("../types").Store<T>;
144
144
  export type IStore = import("../types").IStore;
@@ -7,6 +7,6 @@ declare class AccessorCache<T extends import("../../types").State> {
7
7
  [propertyPaths: string]: Readonly<any>;
8
8
  };
9
9
  unlinkClient(clientId: string): void;
10
- watchSource(changes: import("../../types").UpdatePayload<import("../../types").PartialState<T>>): void;
10
+ watchSource(changes: import("../../types").Changes<T>): void;
11
11
  #private;
12
12
  }
package/dist/types.d.ts CHANGED
@@ -19,7 +19,7 @@ export type IStore = {
19
19
  subscribe: NonReactUsageReport;
20
20
  };
21
21
  export type KeyType = number | string | symbol;
22
- export type Listener<T extends State> = (changes: UpdatePayload<PartialState<T>>) => void;
22
+ export type Listener<T extends State> = (changes: Changes<T>) => void;
23
23
  export type NonReactUsageReport = () => never;
24
24
  export type PartialState<T extends State> = { [K in keyof T]?: T[K]; };
25
25
  export type Prehooks<T extends State> = {
@@ -27,7 +27,7 @@ export type Prehooks<T extends State> = {
27
27
  current: T;
28
28
  original: T;
29
29
  }) => boolean;
30
- setState?: (newChanges: PartialState<T>) => boolean;
30
+ setState?: (newChanges: Changes<T>) => boolean;
31
31
  };
32
32
  export type State = {
33
33
  [x: string]: any;
@@ -36,7 +36,7 @@ export type State = {
36
36
  };
37
37
  export type StoreInternal<T extends State> = {
38
38
  resetState: (propertyPaths?: string[]) => void;
39
- setState: (changes: UpdatePayload<PartialState<T>>) => void;
39
+ setState: (changes: Changes<T>) => void;
40
40
  } & {
41
41
  getState: (clientId: string, ...propertyPaths?: string[]) => {
42
42
  [propertyPaths: string]: Readonly<any>;
@@ -47,8 +47,9 @@ export type StoreInternal<T extends State> = {
47
47
  export type Store<T extends State> = {
48
48
  data: Data;
49
49
  resetState: (propertyPaths?: string[]) => void;
50
- setState: (changes: UpdatePayload<PartialState<T>>) => void;
50
+ setState: (changes: Changes<T>) => void;
51
51
  };
52
+ export type Changes<T extends State> = UpdatePayload<PartialState<T>>;
52
53
  export type UpdateStats = {
53
54
  hasChanges: boolean;
54
55
  };
package/package.json CHANGED
@@ -133,5 +133,5 @@
133
133
  "test:watch": "eslint --fix && jest --updateSnapshot --watchAll"
134
134
  },
135
135
  "types": "dist/main/index.d.ts",
136
- "version": "4.1.1"
136
+ "version": "4.1.2"
137
137
  }