react-native-global-state-hooks 2.1.4 → 2.1.5

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.
Files changed (2) hide show
  1. package/README.md +6 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -209,12 +209,14 @@ export class GlobalStoreAsync<
209
209
  protected onStateChanged = ({
210
210
  getState,
211
211
  }: StateChangesParam<TState, TMetadata, NonNullable<TStateSetter>>) => {
212
- const state = getState();
213
- const formattedObject = formatToStore(state);
214
- const jsonValue = JSON.stringify(formattedObject);
215
212
  const { asyncStorageKey } = this.config;
216
213
 
217
- asyncStorage.setItem(asyncStorageKey, jsonValue);
214
+ const state = getState();
215
+ const formattedObject = formatToStore(state, {
216
+ stringify: true,
217
+ });
218
+
219
+ asyncStorage.setItem(asyncStorageKey, formattedObject);
218
220
  };
219
221
  }
220
222
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-global-state-hooks",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
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": [