react-native-global-state-hooks 2.0.3 → 2.0.4

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.
@@ -1,16 +1,28 @@
1
1
  /// <reference types="lodash" />
2
2
  import * as IGlobalStore from './GlobalStoreTypes';
3
3
  export declare const isPrimitive: <T>(value: T) => boolean;
4
- export declare class GlobalStore<IState, IPersist extends string | null = null, IsPersist extends boolean = IPersist extends null ? false : true, IActions extends IGlobalStore.IActionCollectionConfig<IState> | null = null> implements IGlobalStore.IGlobalState<IState, IPersist, IsPersist, IActions> {
4
+ export declare type IValueWithMedaData = {
5
+ _type_?: 'map' | 'set' | 'date';
6
+ value?: unknown;
7
+ };
8
+ export declare class GlobalStore<IState, IPersist extends string | null, IActions extends IGlobalStore.IActionCollectionConfig<IState> | null = null> implements IGlobalStore.IGlobalState<IState, IPersist, IActions> {
5
9
  protected state: IState;
6
10
  protected actions: IActions;
7
11
  persistStoreAs: IPersist;
12
+ /**
13
+ * This function can be used to format the data after it is loaded from the asyncStorage
14
+ */
15
+ onPersistStorageLoad: (obj: unknown) => (IState | null);
8
16
  subscribers: IGlobalStore.StateSetter<IState>[];
9
17
  get isPersistStore(): boolean;
10
- constructor(state: IState, actions?: IActions, persistStoreAs?: IPersist);
18
+ constructor(state: IState, actions?: IActions, persistStoreAs?: IPersist,
19
+ /**
20
+ * This function can be used to format the data after it is loaded from the asyncStorage
21
+ */
22
+ onPersistStorageLoad?: (obj: unknown) => (IState | null));
11
23
  private get isStoredStateItemUpdated();
12
24
  private storedStateItem;
13
- protected formatItemFromStore<T>(obj: T): unknown;
25
+ protected formatItemFromStore<T>(_obj: T): unknown;
14
26
  protected formatToStore<T>(obj: T): unknown;
15
27
  protected getAsyncStoreItemPromise: Promise<IState> | null;
16
28
  protected asyncStorageGetItem(): Promise<string | null>;
@@ -18,7 +30,7 @@ export declare class GlobalStore<IState, IPersist extends string | null = null,
18
30
  protected asyncStorageSetItem(valueToStore: string): Promise<void>;
19
31
  protected setAsyncStoreItem(): Promise<void>;
20
32
  protected getStateCopy: () => IState;
21
- getHook: <IApi extends IGlobalStore.IActionCollectionResult<IState, IActions> | null = IActions extends null ? null : IGlobalStore.IActionCollectionResult<IState, IActions>>() => () => [IState, IGlobalStore.IHookResult<IState, IActions, IApi>, IsPersist extends true ? boolean : null];
33
+ getHook: <IApi extends IGlobalStore.IActionCollectionResult<IState, IActions> | null = IActions extends null ? null : IGlobalStore.IActionCollectionResult<IState, IActions>>() => () => [IState, IGlobalStore.IHookResult<IState, IActions, IApi>, IPersist extends null ? false : boolean];
22
34
  getHookDecoupled: <IApi extends IGlobalStore.IActionCollectionResult<IState, IActions> | null = IActions extends null ? null : IGlobalStore.IActionCollectionResult<IState, IActions>>() => [() => IPersist extends string ? Promise<IState> : IState, IGlobalStore.IHookResult<IState, IActions, IApi>];
23
35
  private _stateOrchestrator;
24
36
  protected get stateOrchestrator(): IGlobalStore.StateSetter<IState> | IGlobalStore.IActionCollectionResult<IState, IActions>;
@@ -35,6 +47,7 @@ export declare class GlobalStore<IState, IPersist extends string | null = null,
35
47
  */
36
48
  static ExecutePendingBatches: import("lodash").DebouncedFunc<() => void>;
37
49
  protected getActions: <IApi extends IGlobalStore.IActionCollectionResult<IState, IGlobalStore.IActionCollectionConfig<IState>>>() => IApi;
50
+ deleteAsyncStoreItem: () => Promise<void>;
38
51
  }
39
52
  export default GlobalStore;
40
53
  //# sourceMappingURL=GlobalStore.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"GlobalStore.d.ts","sourceRoot":"","sources":["../src/GlobalStore.ts"],"names":[],"mappings":";AAKA,OAAO,KAAK,YAAY,MAAM,oBAAoB,CAAC;AAEnD,eAAO,MAAM,WAAW,0BAAuH,CAAC;AAEhJ,qBAAa,WAAW,CACtB,MAAM,EACN,QAAQ,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,EACrC,SAAS,SAAS,OAAO,GAAG,QAAQ,SAAS,IAAI,GAAG,KA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E;IACF,SAAS,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,MAAM,IAAI,EAAE,MAAM,CAAC,EAAE,CAAM;IAE7D,SAAS,CAAC,YAAY,6BAA8B,MAAM,KAAK,MAAM,aAAa,MAAM,IAAI,UAqB1F;IAEF,SAAS,CAAC,iBAAiB,6BAAoC,MAAM,KAAK,MAAM,MAC9E,QAAQ,MAAM,CAAC,CAAmF;IAEpG,SAAS,CAAC,+BAA+B,6BAAoC,MAAM,KAAK,MAAM,MAAI,QAAQ,MAAM,CAAC,CAK/G;IAEF,MAAM,CAAC,8BAA8B,EAAE,CAAC,MAAM,IAAI,CAAC,EAAE,CAAM;IAE3D;;MAEE;IACF,MAAM,CAAC,qBAAqB,6CAQtB;IAEN,SAAS,CAAC,UAAU,sHA0BlB;IAEK,oBAAoB,QAAa,QAAQ,IAAI,CAAC,CAIpD;CAEF;AAED,eAAe,WAAW,CAAC"}
@@ -8,10 +8,15 @@ const async_storage_1 = (0, tslib_1.__importDefault)(require("@react-native-asyn
8
8
  const isPrimitive = (value) => (0, lodash_1.isNil)(value) || (0, lodash_1.isNumber)(value) || (0, lodash_1.isBoolean)(value) || (0, lodash_1.isString)(value) || typeof value === 'symbol';
9
9
  exports.isPrimitive = isPrimitive;
10
10
  class GlobalStore {
11
- constructor(state, actions = null, persistStoreAs = null) {
11
+ constructor(state, actions = null, persistStoreAs = null,
12
+ /**
13
+ * This function can be used to format the data after it is loaded from the asyncStorage
14
+ */
15
+ onPersistStorageLoad = () => null) {
12
16
  this.state = state;
13
17
  this.actions = actions;
14
18
  this.persistStoreAs = persistStoreAs;
19
+ this.onPersistStorageLoad = onPersistStorageLoad;
15
20
  this.subscribers = [];
16
21
  this.storedStateItem = undefined;
17
22
  this.getAsyncStoreItemPromise = null;
@@ -81,6 +86,11 @@ class GlobalStore {
81
86
  return result;
82
87
  }) })), {});
83
88
  };
89
+ this.deleteAsyncStoreItem = () => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
90
+ if (!this.isPersistStore)
91
+ return;
92
+ yield async_storage_1.default.removeItem(this.persistStoreAs);
93
+ });
84
94
  }
85
95
  get isPersistStore() {
86
96
  return !!this.persistStoreAs;
@@ -88,30 +98,73 @@ class GlobalStore {
88
98
  get isStoredStateItemUpdated() {
89
99
  return this.storedStateItem !== undefined;
90
100
  }
91
- formatItemFromStore(obj) {
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
+ }
92
124
  const isArray = Array.isArray(obj);
93
125
  if (isArray) {
94
126
  return obj.map((item) => this.formatItemFromStore(item));
95
127
  }
96
- return Object.keys(obj).filter((key) => !key.includes('_type')).reduce((acumulator, key) => {
97
- const type = obj[`${key}_type`];
128
+ const keys = Object.keys(obj);
129
+ return keys.reduce((acumulator, key) => {
98
130
  const unformatedValue = obj[key];
99
- const isDateType = type === 'date';
100
- if (isDateType) {
101
- return Object.assign(Object.assign({}, acumulator), { [key]: new Date(unformatedValue) });
102
- }
103
- return Object.assign(Object.assign({}, acumulator), { [key]: (0, exports.isPrimitive)(unformatedValue) ? unformatedValue : this.formatItemFromStore(unformatedValue) });
131
+ return Object.assign(Object.assign({}, acumulator), { [key]: this.formatItemFromStore(unformatedValue) });
104
132
  }, {});
105
133
  }
106
134
  formatToStore(obj) {
135
+ if ((0, exports.isPrimitive)(obj)) {
136
+ return obj;
137
+ }
107
138
  const isArray = Array.isArray(obj);
108
139
  if (isArray) {
109
140
  return obj.map((item) => this.formatToStore(item));
110
141
  }
111
- return Object.keys(obj).reduce((acumulator, key) => {
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) => {
112
166
  const value = obj[key];
113
- const isDatetime = value instanceof Date;
114
- return (Object.assign(Object.assign({}, acumulator), { [key]: (0, exports.isPrimitive)(value) || isDatetime ? value : this.formatToStore(value), [`${key}_type`]: isDatetime ? 'date' : typeof value }));
167
+ return (Object.assign(Object.assign({}, acumulator), { [key]: this.formatToStore(value) }));
115
168
  }, {});
116
169
  }
117
170
  asyncStorageGetItem() {
@@ -125,11 +178,13 @@ class GlobalStore {
125
178
  return this.getAsyncStoreItemPromise;
126
179
  this.getAsyncStoreItemPromise = new Promise((resolve) => {
127
180
  (() => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
181
+ var _a;
128
182
  const item = yield this.asyncStorageGetItem();
129
183
  if (item) {
130
- const value = JSON.parse(item);
131
- const primitive = (0, exports.isPrimitive)(value);
132
- const newState = primitive || Array.isArray(value) ? value : this.formatItemFromStore(value);
184
+ let value = JSON.parse(item);
185
+ /** This allow users to review what is been stored */
186
+ value = (_a = this.onPersistStorageLoad(value)) !== null && _a !== void 0 ? _a : value;
187
+ const newState = this.formatItemFromStore(value);
133
188
  yield this.globalSetterAsync(newState);
134
189
  }
135
190
  resolve(this.state);
@@ -148,7 +203,7 @@ class GlobalStore {
148
203
  if (this.storedStateItem === this.state)
149
204
  return;
150
205
  this.storedStateItem = this.state;
151
- const valueToStore = (0, exports.isPrimitive)(this.state) ? this.state : this.formatToStore((0, lodash_1.cloneDeep)(this.state));
206
+ const valueToStore = this.formatToStore((0, lodash_1.cloneDeep)(this.state));
152
207
  yield this.asyncStorageSetItem(JSON.stringify(valueToStore));
153
208
  });
154
209
  }
@@ -36,17 +36,21 @@ export declare type IHookResult<IState, IActions extends IActionCollectionConfig
36
36
  * this will disable the default return of the state-setter of the hook, and instead will return the API
37
37
  * @param {string} persistStoreAs - A name if you want to persist the state of the store in localstorage
38
38
  * */
39
- export interface IGlobalState<IState, IPersist extends string | null = null, IsPersist extends boolean = IPersist extends null ? false : true, IActions extends IActionCollectionConfig<IState> | null = null> {
39
+ export interface IGlobalState<IState, IPersist extends string | null = null, IActions extends IActionCollectionConfig<IState> | null = null> {
40
40
  persistStoreAs: IPersist;
41
41
  isPersistStore: boolean;
42
42
  /**
43
+ * This function can be used to format the data after it is loaded from the asyncStorage
44
+ */
45
+ onPersistStorageLoad: (obj: unknown) => (IState | null);
46
+ /**
43
47
  * Returns a global hook that will share information across components by subscribing them to a specific store.
44
48
  * @return [currentState, GlobalState.IHookResult<IState, IActions, IApi>, initialStatePersistStorage | null, isUpdatedPersistStorage | null]
45
49
  */
46
50
  getHook: <IApi extends IActions extends IActionCollectionResult<IState, IActions> ? IActionCollectionResult<IState, IActions> : null>() => () => [
47
51
  IState,
48
52
  IHookResult<IState, IActions, IApi>,
49
- IsPersist extends true ? boolean : null
53
+ IPersist extends null ? false : true extends true ? boolean : null
50
54
  ];
51
55
  /**
52
56
  * This is an access to the subscribers queue and to the current state of a specific store...
@@ -57,10 +61,6 @@ export interface IGlobalState<IState, IPersist extends string | null = null, IsP
57
61
  () => IPersist extends string ? Promise<IState> : IState,
58
62
  IHookResult<IState, IActions, IApi>
59
63
  ];
60
- }
61
- /**
62
- * @deprecated This interface name is deprecated, use instead IGlobalState
63
- */
64
- export interface IGlobalStateFactory<IState, IPersist extends string | null = null, IsPersist extends boolean = IPersist extends null ? false : true, IActions extends IActionCollectionConfig<IState> | null = null> extends IGlobalState<IState, IPersist, IsPersist, IActions> {
64
+ deleteAsyncStoreItem: () => Promise<void>;
65
65
  }
66
66
  //# sourceMappingURL=GlobalStoreTypes.d.ts.map
@@ -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,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB;;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,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AAM,EAAE,QAAQ,CAAC,GAAG,uBAAuB,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,IAAI,OAAO;QAClJ,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",
3
+ "version": "2.0.4",
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": [