react-native-global-state-hooks 2.0.4 → 2.0.6
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/lib/GlobalStore.d.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="lodash" />
|
|
2
1
|
import * as IGlobalStore from './GlobalStoreTypes';
|
|
3
|
-
export declare const isPrimitive: <T>(value: T) => boolean;
|
|
4
2
|
export declare type IValueWithMedaData = {
|
|
5
3
|
_type_?: 'map' | 'set' | 'date';
|
|
6
4
|
value?: unknown;
|
|
7
5
|
};
|
|
6
|
+
export declare const debounce: <T extends Function>(callback: T, wait?: number) => T;
|
|
8
7
|
export declare class GlobalStore<IState, IPersist extends string | null, IActions extends IGlobalStore.IActionCollectionConfig<IState> | null = null> implements IGlobalStore.IGlobalState<IState, IPersist, IActions> {
|
|
9
8
|
protected state: IState;
|
|
10
9
|
protected actions: IActions;
|
|
@@ -22,8 +21,6 @@ export declare class GlobalStore<IState, IPersist extends string | null, IAction
|
|
|
22
21
|
onPersistStorageLoad?: (obj: unknown) => (IState | null));
|
|
23
22
|
private get isStoredStateItemUpdated();
|
|
24
23
|
private storedStateItem;
|
|
25
|
-
protected formatItemFromStore<T>(_obj: T): unknown;
|
|
26
|
-
protected formatToStore<T>(obj: T): unknown;
|
|
27
24
|
protected getAsyncStoreItemPromise: Promise<IState> | null;
|
|
28
25
|
protected asyncStorageGetItem(): Promise<string | null>;
|
|
29
26
|
protected getAsyncStoreItem(): Promise<IState>;
|
|
@@ -38,14 +35,12 @@ export declare class GlobalStore<IState, IPersist extends string | null, IAction
|
|
|
38
35
|
** [subscriber-update-callback, hook]
|
|
39
36
|
*/
|
|
40
37
|
protected static batchedUpdates: [() => void, object][];
|
|
41
|
-
protected globalSetter: (setter: IState | ((state: IState) => IState)
|
|
42
|
-
protected globalSetterAsync: (setter: IState | ((state: IState) => IState)) => Promise<IState>;
|
|
38
|
+
protected globalSetter: (setter: IState | ((state: IState) => IState)) => void;
|
|
43
39
|
protected globalSetterToPersistStoreAsync: (setter: IState | ((state: IState) => IState)) => Promise<IState>;
|
|
44
|
-
static ExecutePendingBatchesCallbacks: (() => void)[];
|
|
45
40
|
/**
|
|
46
|
-
* React native cannot use unstable_batchedUpdates
|
|
41
|
+
* React native cannot use unstable_batchedUpdates
|
|
47
42
|
*/
|
|
48
|
-
static ExecutePendingBatches:
|
|
43
|
+
static ExecutePendingBatches: () => void;
|
|
49
44
|
protected getActions: <IApi extends IGlobalStore.IActionCollectionResult<IState, IGlobalStore.IActionCollectionConfig<IState>>>() => IApi;
|
|
50
45
|
deleteAsyncStoreItem: () => Promise<void>;
|
|
51
46
|
}
|
package/lib/GlobalStore.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalStore.d.ts","sourceRoot":"","sources":["../src/GlobalStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GlobalStore.d.ts","sourceRoot":"","sources":["../src/GlobalStore.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAEnD,oBAAY,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAA;AAED,eAAO,MAAM,QAAQ,uDAUpB,CAAC;AAEF,qBAAa,WAAW,CACtB,MAAM,EACN,QAAQ,SAAS,MAAM,GAAG,IAAI,EAC9B,QAAQ,SAAS,YAAY,CAAC,uBAAuB,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,CAC3E,YAAW,YAAY,CAAC,YAAY,CAAC,MAAM,EAAE,QAAQ,EAAE,QAAQ,CAAC;IAS9D,SAAS,CAAC,KAAK,EAAE,MAAM;IACvB,SAAS,CAAC,OAAO,EAAE,QAAQ;IACpB,cAAc,EAAE,QAAQ;IAE/B;;MAEE;IACK,oBAAo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MAAM,KAAK,MAAM,MAAI,QAAQ,MAAM,CAAC,CAK/G;IAEF;;MAEE;IACF,MAAM,CAAC,qBAAqB,aAM3B;IAED,SAAS,CAAC,UAAU,sHA0BlB;IAEK,oBAAoB,QAAa,QAAQ,IAAI,CAAC,CAIpD;CAEF;AAED,eAAe,WAAW,CAAC"}
|
package/lib/GlobalStore.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GlobalStore = exports.
|
|
3
|
+
exports.GlobalStore = exports.debounce = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const
|
|
6
|
+
const json_storage_formatter_1 = require("json-storage-formatter");
|
|
7
7
|
const async_storage_1 = (0, tslib_1.__importDefault)(require("@react-native-async-storage/async-storage"));
|
|
8
|
-
const
|
|
9
|
-
|
|
8
|
+
const debounce = (callback, wait = 300) => {
|
|
9
|
+
let timer;
|
|
10
|
+
return ((...args) => {
|
|
11
|
+
clearTimeout(timer);
|
|
12
|
+
timer = setTimeout(() => {
|
|
13
|
+
callback(...args);
|
|
14
|
+
}, wait);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
exports.debounce = debounce;
|
|
10
18
|
class GlobalStore {
|
|
11
19
|
constructor(state, actions = null, persistStoreAs = null,
|
|
12
20
|
/**
|
|
@@ -20,7 +28,7 @@ class GlobalStore {
|
|
|
20
28
|
this.subscribers = [];
|
|
21
29
|
this.storedStateItem = undefined;
|
|
22
30
|
this.getAsyncStoreItemPromise = null;
|
|
23
|
-
this.getStateCopy = () => Object.freeze((0,
|
|
31
|
+
this.getStateCopy = () => Object.freeze((0, json_storage_formatter_1.clone)(this.state));
|
|
24
32
|
this.getHook = () => () => {
|
|
25
33
|
const [value, setter] = (0, react_1.useState)(() => this.state);
|
|
26
34
|
(0, react_1.useEffect)(() => {
|
|
@@ -46,7 +54,7 @@ class GlobalStore {
|
|
|
46
54
|
];
|
|
47
55
|
};
|
|
48
56
|
this._stateOrchestrator = null;
|
|
49
|
-
this.globalSetter = (setter
|
|
57
|
+
this.globalSetter = (setter) => {
|
|
50
58
|
// avoid perform multiple updates over the same state
|
|
51
59
|
GlobalStore.batchedUpdates = GlobalStore.batchedUpdates.filter(([, hook]) => {
|
|
52
60
|
const isSameHook = hook === this;
|
|
@@ -60,12 +68,10 @@ class GlobalStore {
|
|
|
60
68
|
this.state = newState;
|
|
61
69
|
// batch store updates
|
|
62
70
|
GlobalStore.batchedUpdates.push([() => this.subscribers.forEach((updateChild) => updateChild(newState)), this]);
|
|
63
|
-
GlobalStore.ExecutePendingBatchesCallbacks.push(callback);
|
|
64
71
|
GlobalStore.ExecutePendingBatches();
|
|
65
72
|
};
|
|
66
|
-
this.globalSetterAsync = (setter) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () { return new Promise((resolve) => this.globalSetter(setter, () => resolve(this.state))); });
|
|
67
73
|
this.globalSetterToPersistStoreAsync = (setter) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
68
|
-
|
|
74
|
+
this.globalSetter(setter);
|
|
69
75
|
yield this.setAsyncStoreItem();
|
|
70
76
|
return this.state;
|
|
71
77
|
});
|
|
@@ -73,7 +79,7 @@ class GlobalStore {
|
|
|
73
79
|
const actions = this.actions;
|
|
74
80
|
// Setter is allways async because of the render batch
|
|
75
81
|
// but we are typing the setter as synchronous to avoid the developer has extra complexity that useState do not handle
|
|
76
|
-
const setter = this.isPersistStore ? this.globalSetterToPersistStoreAsync : this.
|
|
82
|
+
const setter = this.isPersistStore ? this.globalSetterToPersistStoreAsync : this.globalSetter;
|
|
77
83
|
return Object.keys(actions).reduce((accumulator, key) => (Object.assign(Object.assign({}, accumulator), { [key]: (...parameres) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
78
84
|
let promise;
|
|
79
85
|
const setterWrapper = (value) => {
|
|
@@ -98,75 +104,6 @@ class GlobalStore {
|
|
|
98
104
|
get isStoredStateItemUpdated() {
|
|
99
105
|
return this.storedStateItem !== undefined;
|
|
100
106
|
}
|
|
101
|
-
formatItemFromStore(_obj) {
|
|
102
|
-
var _a, _b;
|
|
103
|
-
const obj = _obj;
|
|
104
|
-
if ((0, exports.isPrimitive)(obj)) {
|
|
105
|
-
return obj;
|
|
106
|
-
}
|
|
107
|
-
const isMetaDate = (obj === null || obj === void 0 ? void 0 : obj._type_) === 'date';
|
|
108
|
-
if (isMetaDate) {
|
|
109
|
-
return new Date(obj.value);
|
|
110
|
-
}
|
|
111
|
-
const isMetaMap = (obj === null || obj === void 0 ? void 0 : obj._type_) === 'map';
|
|
112
|
-
if (isMetaMap) {
|
|
113
|
-
const mapData = ((_a = obj.value) !== null && _a !== void 0 ? _a : []).map(([key, item]) => [
|
|
114
|
-
key,
|
|
115
|
-
this.formatItemFromStore(item),
|
|
116
|
-
]);
|
|
117
|
-
return new Map(mapData);
|
|
118
|
-
}
|
|
119
|
-
const isMetaSet = (obj === null || obj === void 0 ? void 0 : obj._type_) === 'set';
|
|
120
|
-
if (isMetaSet) {
|
|
121
|
-
const setData = (_b = obj.value) !== null && _b !== void 0 ? _b : [].map((item) => this.formatItemFromStore(item));
|
|
122
|
-
return new Set(setData);
|
|
123
|
-
}
|
|
124
|
-
const isArray = Array.isArray(obj);
|
|
125
|
-
if (isArray) {
|
|
126
|
-
return obj.map((item) => this.formatItemFromStore(item));
|
|
127
|
-
}
|
|
128
|
-
const keys = Object.keys(obj);
|
|
129
|
-
return keys.reduce((acumulator, key) => {
|
|
130
|
-
const unformatedValue = obj[key];
|
|
131
|
-
return Object.assign(Object.assign({}, acumulator), { [key]: this.formatItemFromStore(unformatedValue) });
|
|
132
|
-
}, {});
|
|
133
|
-
}
|
|
134
|
-
formatToStore(obj) {
|
|
135
|
-
if ((0, exports.isPrimitive)(obj)) {
|
|
136
|
-
return obj;
|
|
137
|
-
}
|
|
138
|
-
const isArray = Array.isArray(obj);
|
|
139
|
-
if (isArray) {
|
|
140
|
-
return obj.map((item) => this.formatToStore(item));
|
|
141
|
-
}
|
|
142
|
-
const isMap = obj instanceof Map;
|
|
143
|
-
if (isMap) {
|
|
144
|
-
const pairs = Array.from(obj.entries());
|
|
145
|
-
return {
|
|
146
|
-
_type_: 'map',
|
|
147
|
-
value: pairs.map((pair) => this.formatToStore(pair)),
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
const isSet = obj instanceof Set;
|
|
151
|
-
if (isSet) {
|
|
152
|
-
const values = Array.from(obj.values());
|
|
153
|
-
return {
|
|
154
|
-
_type_: 'set',
|
|
155
|
-
value: values.map((value) => this.formatToStore(value)),
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
if ((0, lodash_1.isDate)(obj)) {
|
|
159
|
-
return {
|
|
160
|
-
_type_: 'date',
|
|
161
|
-
value: obj.toISOString(),
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
const keys = Object.keys(obj);
|
|
165
|
-
return keys.reduce((acumulator, key) => {
|
|
166
|
-
const value = obj[key];
|
|
167
|
-
return (Object.assign(Object.assign({}, acumulator), { [key]: this.formatToStore(value) }));
|
|
168
|
-
}, {});
|
|
169
|
-
}
|
|
170
107
|
asyncStorageGetItem() {
|
|
171
108
|
return async_storage_1.default.getItem(this.persistStoreAs);
|
|
172
109
|
}
|
|
@@ -184,8 +121,8 @@ class GlobalStore {
|
|
|
184
121
|
let value = JSON.parse(item);
|
|
185
122
|
/** This allow users to review what is been stored */
|
|
186
123
|
value = (_a = this.onPersistStorageLoad(value)) !== null && _a !== void 0 ? _a : value;
|
|
187
|
-
const newState =
|
|
188
|
-
yield this.
|
|
124
|
+
const newState = (0, json_storage_formatter_1.formatFromStore)(value);
|
|
125
|
+
yield this.globalSetter(newState);
|
|
189
126
|
}
|
|
190
127
|
resolve(this.state);
|
|
191
128
|
}))();
|
|
@@ -203,7 +140,7 @@ class GlobalStore {
|
|
|
203
140
|
if (this.storedStateItem === this.state)
|
|
204
141
|
return;
|
|
205
142
|
this.storedStateItem = this.state;
|
|
206
|
-
const valueToStore =
|
|
143
|
+
const valueToStore = (0, json_storage_formatter_1.formatToStore)(this.state);
|
|
207
144
|
yield this.asyncStorageSetItem(JSON.stringify(valueToStore));
|
|
208
145
|
});
|
|
209
146
|
}
|
|
@@ -217,7 +154,7 @@ class GlobalStore {
|
|
|
217
154
|
this._stateOrchestrator = this.globalSetterToPersistStoreAsync;
|
|
218
155
|
}
|
|
219
156
|
else {
|
|
220
|
-
this._stateOrchestrator = this.
|
|
157
|
+
this._stateOrchestrator = this.globalSetter;
|
|
221
158
|
}
|
|
222
159
|
return this._stateOrchestrator;
|
|
223
160
|
}
|
|
@@ -227,16 +164,13 @@ exports.GlobalStore = GlobalStore;
|
|
|
227
164
|
** [subscriber-update-callback, hook]
|
|
228
165
|
*/
|
|
229
166
|
GlobalStore.batchedUpdates = [];
|
|
230
|
-
GlobalStore.ExecutePendingBatchesCallbacks = [];
|
|
231
167
|
/**
|
|
232
|
-
* React native cannot use unstable_batchedUpdates
|
|
168
|
+
* React native cannot use unstable_batchedUpdates
|
|
233
169
|
*/
|
|
234
|
-
GlobalStore.ExecutePendingBatches = (
|
|
170
|
+
GlobalStore.ExecutePendingBatches = () => {
|
|
235
171
|
GlobalStore.batchedUpdates.forEach(([execute]) => {
|
|
236
172
|
execute();
|
|
237
173
|
});
|
|
238
174
|
GlobalStore.batchedUpdates = [];
|
|
239
|
-
|
|
240
|
-
GlobalStore.ExecutePendingBatchesCallbacks = [];
|
|
241
|
-
}, 0);
|
|
175
|
+
};
|
|
242
176
|
exports.default = GlobalStore;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @param {StateSetter<IState>} setter - add a new value to the state
|
|
3
3
|
* @returns {void} result - void
|
|
4
4
|
*/
|
|
5
|
-
export declare type StateSetter<IState> = (setter: IState | ((state: IState) => IState)) =>
|
|
5
|
+
export declare type StateSetter<IState> = (setter: IState | ((state: IState) => IState)) => void;
|
|
6
6
|
/**
|
|
7
7
|
* This is the structure required by the API actions in order to be able to capture action parameters and inject state setter into actions.
|
|
8
8
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalStoreTypes.d.ts","sourceRoot":"","sources":["../src/GlobalStoreTypes.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,oBAAY,WAAW,CAAC,MAAM,IAAI,CAChC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,KACzC,
|
|
1
|
+
{"version":3,"file":"GlobalStoreTypes.d.ts","sourceRoot":"","sources":["../src/GlobalStoreTypes.ts"],"names":[],"mappings":"AAAA;;;EAGE;AACF,oBAAY,WAAW,CAAC,MAAM,IAAI,CAChC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,KACzC,IAAI,CAAC;AAEV;;EAEE;AACF,oBAAY,aAAa,CAAC,MAAM,IAAI,CAElC,GAAG,MAAM,EAAE,GAAG,EAAE,KACb,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAE7E;;EAEE;AACF,MAAM,WAAW,uBAAuB,CAAC,MAAM;IAC7C,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;CACtC;AAED;;EAEE;AACF,oBAAY,uBAAuB,CAAC,MAAM,EAAE,QAAQ,SAAS,uBAAuB,CAAC,MAAM,CAAC,GAAG,IAAI,IAAI;KAEpG,GAAG,IAAI,MAAM,QAAQ,GAAG,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,KAAK,OAAO;CACvD,CAAC;AAEF;;EAEE;AACF,oBAAY,WAAW,CACrB,MAAM,EACN,QAAQ,SAAS,uBAAuB,CAAC,MAAM,CAAC,GAAG,IAAI,GAAG,IAAI,EAC9D,IA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ClJ,MAAM,QAAQ,SAAS,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM;QACxD,WAAW,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC;KACpC,CAAC;IAEF,oBAAoB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-global-state-hooks",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"description": "This is a package to easily handling global-state across your react-native-components No-redux",
|
|
5
5
|
"main": "lib/GlobalStore.js",
|
|
6
6
|
"files": [
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"homepage": "https://github.com/johnny-quesada-developer/react-native-global-state-hooks#readme",
|
|
42
42
|
"devDependencies": {
|
|
43
|
+
"@react-native-async-storage/async-storage": "workspace:*",
|
|
43
44
|
"@types/jest": "^26.0.17",
|
|
44
45
|
"@types/lodash": "^4.14.165",
|
|
45
46
|
"@types/react": "^17.0.0",
|
|
@@ -54,13 +55,16 @@
|
|
|
54
55
|
"eslint-plugin-react": "^7.21.5",
|
|
55
56
|
"eslint-plugin-react-hooks": "^4.2.0",
|
|
56
57
|
"jest": "^26.6.3",
|
|
58
|
+
"react": "workspace:*",
|
|
57
59
|
"react-test-renderer": "^17.0.1",
|
|
58
60
|
"ts-jest": "^26.4.4",
|
|
59
61
|
"typescript": "^4.1.2"
|
|
60
62
|
},
|
|
61
63
|
"peerDependencies": {
|
|
62
64
|
"@react-native-async-storage/async-storage": "workspace:*",
|
|
63
|
-
"lodash": "workspace:*",
|
|
64
65
|
"react": "workspace:*"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"json-storage-formatter": "^1.0.2"
|
|
65
69
|
}
|
|
66
70
|
}
|