@umituz/react-native-storage 2.6.7 → 2.6.8
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-storage",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.8",
|
|
4
4
|
"description": "Unified storage solution with AsyncStorage persistence, Zustand state management, and in-memory caching for React Native",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -36,7 +36,8 @@ export function createStore<
|
|
|
36
36
|
storage: createJSONStorage(() => storageService),
|
|
37
37
|
version: config.version || 1,
|
|
38
38
|
partialize: config.partialize
|
|
39
|
-
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
? (state) => config.partialize!(state as any) as any
|
|
40
41
|
: (state) => {
|
|
41
42
|
const persisted: Record<string, unknown> = {};
|
|
42
43
|
for (const key of Object.keys(state)) {
|
|
@@ -44,11 +45,13 @@ export function createStore<
|
|
|
44
45
|
persisted[key] = state[key as keyof Store];
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
49
|
+
return persisted as any;
|
|
48
50
|
},
|
|
49
51
|
onRehydrateStorage: () => (state) => {
|
|
50
52
|
if (state && config.onRehydrate) {
|
|
51
|
-
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
+
config.onRehydrate(state as any);
|
|
52
55
|
}
|
|
53
56
|
},
|
|
54
57
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|