react-native-global-state-hooks 4.0.0 → 4.0.1

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 +2 -2
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -183,7 +183,7 @@ export const createGlobalState = createCustomGlobalState<
183
183
  isAsyncStorageReady: null,
184
184
  }));
185
185
 
186
- const asyncStorageKey = config.asyncStorageKey;
186
+ const asyncStorageKey = config?.asyncStorageKey;
187
187
  if (!asyncStorageKey) return;
188
188
 
189
189
  const storedItem = (await asyncStorage.getItem(asyncStorageKey)) as string;
@@ -206,7 +206,7 @@ export const createGlobalState = createCustomGlobalState<
206
206
  },
207
207
 
208
208
  onChange: ({ getState }, config) => {
209
- if (!config.asyncStorageKey) return;
209
+ if (!config?.asyncStorageKey) return;
210
210
 
211
211
  const state = getState();
212
212
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-global-state-hooks",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "This is a package to easily handling global-state across your react-native-components No-redux",
5
5
  "main": "lib/bundle.js",
6
6
  "types": "lib/index.d.ts",