pocket-state 0.1.11 → 0.1.12
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/package.json +1 -1
- package/src/globalState/store.ts +3 -3
- package/src/index.tsx +5 -23
package/package.json
CHANGED
package/src/globalState/store.ts
CHANGED
|
@@ -104,14 +104,14 @@ export function createStore<T>(
|
|
|
104
104
|
let changed = false;
|
|
105
105
|
for (const k in nextState as any) {
|
|
106
106
|
const nv = (nextState as any)[k];
|
|
107
|
-
const ov =
|
|
107
|
+
const ov = state[k];
|
|
108
108
|
if (nv !== ov) {
|
|
109
109
|
(delta as any)[k] = nv;
|
|
110
110
|
changed = true;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
for (const k in state
|
|
114
|
-
if (!(k in
|
|
113
|
+
for (const k in state) {
|
|
114
|
+
if (!(k in nextState)) {
|
|
115
115
|
(delta as any)[k] = undefined;
|
|
116
116
|
changed = true;
|
|
117
117
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Listener,
|
|
7
|
-
Middleware,
|
|
8
|
-
MutateFn,
|
|
9
|
-
UseStoreGet,
|
|
10
|
-
UseStoreSet,
|
|
11
|
-
Store,
|
|
12
|
-
} from './globalState/type';
|
|
13
|
-
|
|
14
|
-
export {createStore, useStore, createHook};
|
|
15
|
-
export type {
|
|
16
|
-
IEventEmitter,
|
|
17
|
-
Listener,
|
|
18
|
-
Middleware,
|
|
19
|
-
MutateFn,
|
|
20
|
-
UseStoreGet,
|
|
21
|
-
UseStoreSet,
|
|
22
|
-
Store,
|
|
23
|
-
};
|
|
1
|
+
export * from './globalState/store';
|
|
2
|
+
export * from './globalState/hooks';
|
|
3
|
+
export * from './globalState/create';
|
|
4
|
+
export type * from './globalState/type';
|
|
5
|
+
export * from './globalState/event';
|