@umituz/react-native-storage 2.6.19 → 2.6.20
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.20",
|
|
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",
|
|
@@ -33,12 +33,11 @@ export function createStore<
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
return create<Store>()(
|
|
36
|
-
persist(stateCreator, {
|
|
36
|
+
persist<Store>(stateCreator, {
|
|
37
37
|
name: config.name,
|
|
38
38
|
storage: createJSONStorage(() => storageService),
|
|
39
39
|
version: config.version || 1,
|
|
40
40
|
partialize: config.partialize
|
|
41
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
41
|
? (state: Store) => config.partialize!(state as any) as any
|
|
43
42
|
: (state: Store) => {
|
|
44
43
|
const persisted: Record<string, unknown> = {};
|
|
@@ -47,17 +46,14 @@ export function createStore<
|
|
|
47
46
|
persisted[key] = state[key as keyof Store];
|
|
48
47
|
}
|
|
49
48
|
}
|
|
50
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
51
49
|
return persisted as any;
|
|
52
50
|
},
|
|
53
51
|
onRehydrateStorage: () => (state: Store | undefined) => {
|
|
54
52
|
if (state && config.onRehydrate) {
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
56
53
|
config.onRehydrate(state as any);
|
|
57
54
|
}
|
|
58
55
|
},
|
|
59
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
60
56
|
migrate: config.migrate as any,
|
|
61
|
-
})
|
|
57
|
+
})
|
|
62
58
|
);
|
|
63
59
|
}
|